As an administrator of your own wiki, to edit your own MediaWiki:Sidebar, replace your wiki page's <title> in the title bar with <MediaWiki:Sidebar>. (The editinterface permission needs to be enabled and is enabled for administrators by default; for information on assigning it to other groups, see Manual:User rights.) You may need to use the syntax//yourdomain/yourwiki/index.php?title=MediaWiki:Sidebar&action=edit if you use long URLs.
If you are sure you are logged in with the relevant rights but do not see the edit link, click on the create tab at the top of the page - this will take you to the edit page.
Example sidebar code:
* navigation
** mainpage|mainpage
** Special:RecentChanges|Recent changes
* new heading
** portal-url|portal
** http://www.mediawiki.org|MediaWiki home
Headings
The navigation bar can be split into sections, each with a heading of its own. The heading for each section is taken from the first-level list element ("navigation" and "new heading" in the example above).
If this text corresponds to the name of an interface message (an existing page of that title in the MediaWiki namespace), then the text of that page is used as a label; otherwise, the header title is used as-is.
Bug: no sidebar is shown in the Nostalgia skin (bug 10794).
Links
Second-level list elements are links ("mainpage|mainpage" in the example above), where the format is:
** target|link text
- target
- The link target can be the name of an interface message (page in the MediaWiki namespace) or wiki page, or an external link. In either case, the link can be internal, interwiki, or external. In some cases (such as links with the "&" character), an interface message is necessary. The link target cannot be made dependent on the interface language set in the preferences.
-
Algorithm followed:
- Get the target text.
- If there is an existing or default interface message with that name, use the content of that message instead of the target text.
- If the output from the previous step is a valid URL (beginning with http:// or other URL protocol), the link will point to that URL.
- Else, it will treat it as the link target of a wikilink (linking to that page name or interwiki).
- In case it would end up linking to '-', the whole entry is removed from the sidebar (that's useful for removing an entry on all languages by changing the message holding the link).
-
Examples:
- "
** portal-url|portal
" uses the text of MediaWiki:Portal-url (which contains "Project:Community portal").
- "
** Special:RecentChanges|Recent changes
" links to Special:RecentChanges, since there is no interface message of that name.
- "
** w:Foo|Some interwiki page
" links to w:Foo for the same reason.
- "
** http://www.mediawiki.org|MediaWiki home
" links to http://www.mediawiki.org for the same reason.
- text
-
The link text can be the name of an interface message (page in the MediaWiki namespace) or plain text.
- If the link text is the name of an existing or default interface message, the content of that message will be used. MediaWiki will check for localized versions; for example, if the current language is fr (French) and the link text is the interface message "forum", it will check for "forum/fr" before using "forum".
- Otherwise, the link text is used as the target as-is.
- Notice that the link text is not optional as in normal wiki links. If the link text is missing, the item is ignored.
-
Examples:
-
** Homepage|mainpage
uses MediaWiki:Mainpage (which contains "MediaWiki").
-
** Special:Recentchanges|Recent changes
uses "Recent changes", since there is no interface message of that name.
Order of elements
By default, the sidebar consists of elements in this order: navigation, search, toolbox, languages. The order can be changed (in MediaWiki 1.13+) by adding special keywords (SEARCH, TOOLBOX and LANGUAGES) to MediaWiki:Sidebar using the heading syntax. For example, the following code moves the search box to the top of the sidebar:
* SEARCH
* navigation
** mainpage|mainpage
** Special:Recentchanges|Recent changed
* new heading
** portal-url|portal
** http://www.mediawiki.org|MediaWiki home