MediaWiki Administrator's Handbook/Sidebar

< MediaWiki Administrator's Handbook

Working with the Navigation Side Bar

One of the more esoteric features of MediaWiki software that is under the control of an administrator is the maintenance of the navigation side bar that appears (usually) to the left of the content on all MediaWiki pages.

Accessing the Side Bar Template

The main sidebar template is kept in the collection of standard MediaWiki messages that may be edited by or protected from ordinary users just like any other template. These pages are always protected from editing, however, unless you have administrator rights.

The typical page for this in the MediaWiki software is found at MediaWiki:Sidebar, and can be found on all MediaWiki projects.

Default Settings

The default sidebar information for most MediaWiki installations is as follows:


* navigation 
** mainpage|main 
** portal-url|portal 
** ict-url|ict 
** currentevents-url|currentevents 
** recentchanges-url|recentchanges 
** randompage-url|randompage 
** helppage|help 
** sitesupport-url|sitesupport

Explaining features

There are two sorts of links that can be added through this interface:

Both of these have advantages and disadvantages which will be explained below.

Predefined Project Variables

The default setup of the navigation bar is only the predefined variables, so a common misconception is that this is the only sort of item that can appear on the navigation bar. Indeed prior to MediaWiki 1.5 this was the only way that you could make changes to the navigation bar, so it is common for people to still use this approach.

The values for these project variables must be changed from the list of System messages directly. For example from the default example above regarding the current events link, currentevents-url can be changed at MediaWiki:Currentevents-url and currentevents at MediaWiki:Currentevents. Note that if you want to change the page links or even the text of the navigation bar for this one item, you don't even need to edit the navigation bar itself directly but simply need to edit the variable link instead.

An additional description is available if you edit MediaWiki:Monobook.js that is related to each project variable that appears as a "hint text" for each project variable.

Advantages

Disadvantages

Direct Project Links

This is a more recent feature for adding in the navigation bar, but is much easier to work with. Specific syntax issues will be addressed in the next major section.

Advantages

Disadvantages

Sidebar Syntax

It is important to note that either naming convention can be used to help rearrange the order of the links on the sidebar, and both may be used simultaneously. You are not restricted to sticking to one naming convention.

MediaWiki software uses the unordered list syntax for keeping track of items in the sidebar. Major sections are delimited by a single asterisk (*) and individual links by two asterisks (**). Additional levels may be added depending on the nature of the link, but only affect indentation of links on the sidebar and should be used very sparingly.

Following the asterisk, the link is added by using the format of URL (or page link) followed by the public description of that link. There is no need to use the [[ or ]] brackets to form these links as the MediaWiki software will do this automatically.

Here is an example of a modified sidebar from the default:


* navigation 
** mainpage|mainpage 
** portal-url|portal 
** currentevents-url|currentevents 
** helppage|help 
** sitesupport-url|sitesupport
** Project:Village Pump|Village Pump

* tools
** recentchanges-url|recentchanges 
** randompage-url|randompage 

Note here that Recent Changes and the Random Page links have been moved to a completely separate section. As an example, a link to the main project discussion page has been added.

Other text or even images can be added to this sidebar, but you should be careful as it is used on every project page and has a major draw on server resources as a result. This is something that should be kept very simple and neat as a guideline.

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.