add a new navigation box to MediaWiki

Overview
"Navigation Box" refers to either of the two sets of links in the control bar -- displayed at left under the wiki logo in MonoBook, possibly elsewhere with other skins. Normally there are three: "navigation", "search", and "toolbox". These can easily be modified extensively, but I wanted to add another one for links back to the "main site" (of which the wiki was just a part). Unfortunately, it looks like this has to be done separately for each skin (I guess the thinking is that a given skin might want to give each box special treatment, though it would be nice if there were a way to set up default handling for all boxes). Looking just at MonoBook.php, this code produces the box normally labeled "navigation":

&lt;h5> msg('navigation') ?> &lt;div class="pBody"> &lt;ul> data['navigation_urls'] as $navlink) { ?> &lt;li id=""> &lt;a href=""> &lt;/li>   Immediately after that, I added the following: &lt;!-- 2005-06-16 Woozle customizations --> &lt;h5> msg('backlinks') ?> &lt;div class="pBody"> &lt;ul> data['backlink_urls'] as $navlink) { ?> &lt;li id=""> &lt;a href=""> &lt;/li>   &lt;!-- end custom code -->

Reloading the page after this change produced no immediate results, but some time later a cache must have expired and some error messages appeared under the "navigation" box. After that, I defined MediaWiki:backlinks to contain "vbz links", and a box labeled "vbz links" faithfully appeared (with an error message in it). Next, I added the following code to LocalSettings.php (near the end, just before the "?>"):

$wgMainsiteLinks = array ( array( 'text'=>'sitelink1','href'=>'sitelink1-url' ),  array( 'text'=>'sitelink2','href'=>'sitelink2-url' ),  array( 'text'=>'sitelink3','href'=>'sitelink3-url' ),  array( 'text'=>'sitelink4','href'=>'sitelink4-url' ),  array( 'text'=>'sitelink5','href'=>'sitelink5-url' ),  array( 'text'=>'sitelink6','href'=>'sitelink6-url' ),  array( 'text'=>'sitelink7','href'=>'sitelink7-url' ),  array( 'text'=>'sitelink8','href'=>'sitelink8-url' ),  array( 'text'=>'sitelink9','href'=>'sitelink9-url' ), ); (Note: I discovered by accident that either "_url" or "-url" will work as a prefix, but they're not equivalent; if you change the value and the control bar doesn't appear to change, make sure you're not confusing them with each other.) Then I modified SkinTemplate.php (the top and bottom lines were there already): $tpl->set( 'navigation_urls', $this->buildNavigationUrls ); $tpl->set( 'mainsite_urls', $this->buildMainsiteUrls ); // # 2005-06-16 Woozle customization $tpl->set( 'nav_urls', $this->buildNavUrls ); ...and finally MonoBook.php (inserted area as indicated by comments): &lt;h5> <?php $this->msg('navigation')?> &lt;div class="pBody"> &lt;ul><?php foreach($this->data['navigation_urls'] as $navlink) { ?> &lt;li id="<?php echo htmlspecialchars($navlink['id']) ?>"> &lt;a href="<?php echo htmlspecialchars($navlink['href'])?>"><?php echo htmlspecialchars($navlink['text']) ?></a> &lt;/li> <?php } ?> </ul> &lt;!-- 2005-06-16 Woozle customizations --> &lt;h5> <?php $this->msg('backlinks') ?> &lt;div class="pBody"> &lt;ul> <?php foreach($this->data['mainsite_urls'] as $navlink) { ?> &lt;li id="<?php echo htmlspecialchars($navlink['id']) ?>"> &lt;a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php echo htmlspecialchars($navlink['text']) ?></a> &lt;/li> <?php } ?> </ul> I think that's all the code mods I made. Once those are done, all that's left is to modify MediaWiki:Sitelink1, MediaWiki:Sitelink1-url, and so on. To make a line disappear (without removing it from the custom code), set the displayed text to "-".
 * 1) 2005-06-16 Woozle customizations: define "backlinks" and "backlink_urls" for custom skin code:
 * 1) end Woozle customization