You are not logged in.
Pages: 1
I cloned the ArchLinux wiki following this topic: https://bbs.archlinux.org/viewtopic.php?id=76683. I adjusted it to the 1.23.3 versions and after completing the additional templates everything is well. The last thing I want to do is have my own links in the navbar, within ArchLinux they are Home, Packages, Forums, Wiki, Bugs, AUR and Download.
The lines for the navbar reside in ArchLinux.php. The code specific to the navbar looks like this:
<div id="archnavbar"><!-- Arch Linux global navigation bar -->
<div id="archnavbarlogo">
<p><a id="logo" href="<?php if (isset($wgArchHome)) { echo $wgArchHome; } ?>"></a></p>
</div>
<div id="archnavbarmenu">
<ul id="archnavbarlist">
<?php
if (isset($wgArchNavBar)) {
foreach ($wgArchNavBar as $name => $url) {
if ((isset($wgArchNavBarSelected) && $this->data['title'] == $name && in_array($name, $wgArchNavBarSelected))
|| (!(isset($wgArchNavBarSelected) && in_array($this->data['title'], $wgArchNavBarSelected)) && isset($wgArchNavBarSelectedDefault) && $name == $wgArchNavBarSelectedDefau$
$anbClass = ' class="anb-selected"';
} else {
$anbClass = '';
}
echo '<li id="anb-'.strtolower($name).'"'.$anbClass.'><a href="'.$url.'">'.$name.'</a></li>';
}
}
?>
</ul>
</div>
</div><!-- #archnavbar -->
It looks like the script is looking for $wgArchNavBar. Where and how do I define this variable?
Last edited by Delectable (2014-09-09 22:54:18)
Offline
I think it uses MediaWiki, right? If so, that'd be defined in LocalSettings.php
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I think it uses MediaWiki, right? If so, that'd be defined in LocalSettings.php
Yes both are true. But when I add
$wgArchNavBar = "http://www.google.com"
to LocalSettings.php it generates a white pages indicating a PHP error. I also wonder how $wgArchNavBarSelected is used in this context, and whether it should be defined in LocalSettings.php as well?
Last edited by Delectable (2014-09-09 22:53:10)
Offline
Why would you add that? What was originally there?
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
When git cloning the ArchWiki Mediawiki instance there was no LocalSettings.php provided. This makes sense as a new install requires a new generated LocalSettings.php, meaning that the links are not defined resulting in an empty navbar.
Offline
Ah, true. But still, why the single url? The code you included in your first post indicates that it needs to be an associative array of names and urls. You just set it to a string value of a single url. That can't work.
I'm pretty much crap with php, but wouldn't that need to be something like:
$wgArchNavBar = array(
"google" => "http://google.com",
);
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
You sir are awesome!!
The array is functioning and the links are showing up as you predicted.
Offline
Pages: 1