Working With MediaWiki
headers with a single equals sign around them will get turned into tabs, without the need for a
tag. You can do this by adding to the global variable $htAutomaticNamespaces, within LocalSettings.php. So to make tabs automatically show up for every page in the main namespace, you would add the following line, below the inclusion of Header Tabs:
$htAutomaticNamespaces[] = NS_MAIN;
(If you don’t know PHP, this line adds the value “NS_MAIN” to the array of values that $htAutomaticNamespaces already held.)
This approach is certainly more convenient; its downside is that you can’t have a section of the page below the tabs area — everything from the last tab name down to the end will become part of the last tab’s contents. (Although you can still manually insert a
tag in the right place to get around this problem.)
In either case, you also need to have at least two such headers on a page for tabs to show up — unless you add "$htRenderSingleTab = true;" to LocalSettings.php.
Tabs are useful for a variety of purposes; though we’ve most often seen them in structured pages, defined by templates and editable with forms (using Semantic Forms — Chapter 17 ). The structured, data-centric nature of such pages makes splitting them into tabs a very natural fit. In this case, it makes sense to have the set of tabs be the same for the page and for the form.
There other customizations you can do, also within LocalSettings.php, to modify some of the other aspects of Header Tabs. By default, every click on a tab adds another page to the browser history, so that hitting the "back" button will bring you back to the previous tab you were on. You can disable this behavior, so that tabs won’t show up in the browser history, by adding the following:
$htUseHistory = false;
Every tab also gets an "edit" link that shows up on the right-hand side. You can remove this link by adding the following:
$htEditTabLink= false;
You can also change the display of the tabs, using the "$htStyle" global variable. The default display is also the nicest-looking one, but you can, for instance, switch to the default display that jQuery UI provides, by adding the following:
$htStyle = 'jquery';
Header Tabs also provides a parser function, #switchtablink, that produces a link to a specific tab, from within either the page on which the tab is located or another page. It is called in the following format:
{{#switchtablink: Tab name | Link text | Page name }}
If the tab is on the same page as the link, only the first two parameters are needed; if it’s called from another page, the third parameter is needed as well.
More information about Header Tabs can be found at:
https://www.mediawiki.org/wiki/Extension:Header_Tabs
13 Display and customization
MediaWiki allows for a lot of customization of its look-and-feel, including changing the text of the interface itself. Such customization is available for both for administrators and users -- we’ll get to both in this chapter.
MediaWiki: pages, and modifying the interface text
One relatively little-known feature of MediaWiki is the fact that you can modify the text of almost any part of the interface, directly through the wiki itself. You just need to find out the identifier of a particular piece of text (referred to in MediaWiki as a "message"), then go to the page named "MediaWiki: message-name ".Take, for example, the "Summary" label that shows up at the bottom of the edit page. This turns out to be confusing for some users, who think that what they’re being asked to summarize is the entire page, not their most recent change. You may consider a label like "Description of edit" to be more useful. If you go to the page "MediaWiki:summary", and enter in the value "Description of edit", that’s how it will show up from then on to all users. To revert, you can simply delete the page.
Wikipedia itself contains some customizations. In MediaWiki the main tab for each page in the main namespace is called, by default, "Page".In the English-language Wikipedia, however, this tab instead appears as "Article". The name of the message holding that value is "nstab-main", and the content of the Wikipedia page "MediaWiki:Nstab-main", is the word "Article". (Looking at the page history, it appears that this value has been changed a number of times, most recently (at the time of this writing) on January 7, 2009.)
A downside of making such a modification is that it’s
Weitere Kostenlose Bücher