Manual:Navigation bar: различия между версиями

Материал из Wiki МИАЦ ВО
Перейти к навигации Перейти к поиску
(Новая: thumb|Sidebar example '''MediaWiki:Sidebar''' defines the navigation bar, which provides links to the most important locations in the wiki and supplies ...)
 
(Customizing the sidebar)
Строка 4: Строка 4:
 
The default Monobook [[Manual:Skins|skin]] places the navigation bar on the top-left (top-right for right-to-left languages) along with the search bar and toolbox, but the placement may be different in other skins.
 
The default Monobook [[Manual:Skins|skin]] places the navigation bar on the top-left (top-right for right-to-left languages) along with the search bar and toolbox, but the placement may be different in other skins.
  
==Customizing the sidebar==
+
nJ5Mnt  <a href="http://wjwyrkivmmmg.com/">wjwyrkivmmmg</a>, [url=http://vqvmcqgsgwua.com/]vqvmcqgsgwua[/url], [link=http://zyxvfwnkqrsg.com/]zyxvfwnkqrsg[/link], http://qdqgmllfgiwm.com/
As an administrator, [[Help:Editing|edit]] the wiki page "[[MediaWiki:Sidebar]]". (The ''editinterface'' right is needed, which is assigned to administrators by default; for information on assigning it to other groups, see [[Help:User rights]].)
 
 
 
Example sidebar code:
 
<pre>
 
* navigation
 
** mainpage|mainpage
 
** Special:Recentchanges|Recent changes
 
* new heading
 
** portal-url|portal
 
** http://www.mediawiki.org|MediaWiki home
 
</pre>
 
 
 
===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:''' only the first section will be shown in the Classic, Cologne Blue, and Simple skins ([[bugzilla:2557|bug 2557]]).<br />
 
'''Bug:''' no sidebar is shown in the Nostalgia skin ([[bugzilla:10794|bug 10794]]).
 
 
 
===Links===
 
Second-level list elements are links ("mainpage|mainpage" in the example above), where the format is:
 
<pre>** target|link text</pre>
 
 
 
====Target====
 
The link target can be the name of an interface message (page in the MediaWiki namespace) or wiki page, or an external link. If the target is the name of an existing or default interface message, the content of that message will be used. Otherwise, the target is used as-is.
 
 
 
In either case, the [[Help:Links|link]] can be internal, interwiki, or external. In some cases (such as links with the "&" character), an interface message is necessary.
 
 
 
Examples:
 
* "<code>** '''portal-url'''|portal</code>" uses the text of [[MediaWiki:Portal-url]] (which contains "{{MediaWiki:Portal-url}}").
 
* "<code>** '''Special:Recentchanges'''|Recent changes</code>" links to [[Special:Recentchanges]], since there is no interface message of that name.
 
* "<code>** '''w:Foo'''|Some interwiki page</code>" links to [[w:Foo]] for the same reason.
 
* "<code>** '''http://www.mediawiki.org'''|MediaWiki home</code>" 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 target is the interface message "forum-url", it will check for "forum-url/fr" before using "forum-url".
 
* 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, <u>the item is ignored</u>.  
 
 
 
Examples:
 
* <code>** mainpage|'''mainpage'''</code> uses [[MediaWiki:Mainpage]] (which contains "{{:MediaWiki:Mainpage}}").
 
* <code>** Special:Recentchanges|'''Recent changes'''</code> uses "Recent changes", since there is no interface message of that name.
 
  
 
==Troubleshooting==
 
==Troubleshooting==

Версия 23:22, 31 декабря 2008

MediaWiki:Sidebar defines the navigation bar, which provides links to the most important locations in the wiki and supplies site administrators with a place to add a persistent collection of links. For instance, most wikis will link to their community discussion page and some useful tools.

The default Monobook skin places the navigation bar on the top-left (top-right for right-to-left languages) along with the search bar and toolbox, but the placement may be different in other skins.

nJ5Mnt <a href="http://wjwyrkivmmmg.com/">wjwyrkivmmmg</a>, [url=http://vqvmcqgsgwua.com/]vqvmcqgsgwua[/url], [link=http://zyxvfwnkqrsg.com/]zyxvfwnkqrsg[/link], http://qdqgmllfgiwm.com/

Troubleshooting

Changes not showing up

MediaWiki aggressively caches content if possible, which often causes the navigation bar to persist after changes. Purging the cache of affected pages should correct the situation. To perform a mass-purge of all caches at once, touch the LocalSettings.php file or truncate the objectcache table in your database (you may have to do both).

You also need to have $wgUseDatabaseMessages set to true.

Lowercase link labels

If your links are not being capitalized as intended, try adding spaces around the bar character; for example:

** http://www.example.com/download.php?file=44555 | Download

Sections disappear or show unexpected content

If a section does not display or displays unexpected content, check that the header text isn't the name of an interface message by searching Special:Allmessages. If it is, use a different header text, or create a new interface message and use it.

For example, if you want to use "Sidebar" as header text, create the interface message "MediaWiki:Sidebar-header" containing only "Sidebar". Then, use * sidebar-header as header.