Working with the Navigation Side Bar

edit

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

edit

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

edit

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

edit

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

  • Predefined project variables
  • Direct project links

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

Predefined Project Variables

edit

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

edit
  • Displays hint text (not available for direct project links)
  • Standard translations are available for default multi-lingual configurations which include these variables

Disadvantages

edit
  • Additional step of trying to hunt down variable pages if you want to make changes
  • Often the actual content in the variable has absolutely nothing to do with the name of the variable. For example, portal-url may in fact be a link to a self-referential parody group of pages or to the main project discussion pages.
  • Adding additional variables requires developer access/root access to the computer that is hosting the content.
edit

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

edit
  • No need to create variables or edit outside of the main side bar template
  • Context of the content is obvious
  • Can be performed by somebody with sysop privileges
  • Less likely to mess up whole project (such as might happen if MediaWiki:Monobook.js is edited with the wrong syntax)

Disadvantages

edit
  • Lack of hint text (is it really that important?) Note that even this may be fixed in a later version of MediaWiki software.
edit

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.

  • Note: Keep in mind that these changes will be very visible to all participants of the project, and that experimentation with this feature is likely to confuse new users to the project. On larger projects with many users, you should try to get a general feel for what changes need to be made from the users rather than arbitrarily make changes on a whim.