Extension:CustomNavBlocks
From MediaWiki.org
|
CustomNavBlocks Release status: stable |
|
|---|---|
| Implementation | Skin |
| Description | Allows you to use normal MediaWiki-pages as contents of your Sidebar |
| Author(s) | Mati Talk |
| Version | 1.0.0 (2008-03-21) |
| MediaWiki | 1.7 or later (most likely older versions too) |
| License | User:Mati/License |
| Download | SourceCode in SVN and Patch Documentation Changelog |
| Parameters | $wgCustomNavBlocksEnable |
| Example | in VoWi |
The CustomNavBlocks Extension allows you to customize your sidebar a lot further than what is possible with MediaWiki:Sidebar. With this extension each block is represented by its own page. That makes it possible to use any kind of element in your Sidebar, including images, numbered lists, nested lists, and so on. For example, this Wiki uses a vertical bar ('----') to separate the link to this page.
Contents |
[edit] Download
The most recent version of this extension can always be found in the CustomNavBlocks-directory of our SVN-repository. Older versions and versions for older MediaWikis may be found in the tags-directory. Please see the repository-readme on how directories are used in the repository.
For this extension to work, you also need to patch MonoBook.php, patches for different versions of MediaWiki can be found in patches/MonoBook.php
[edit] Installation
Installation is a bit different than usual:
- You need to download CustomNavBlocks.php into a directory called 'CustomNavBlocks' in your extensions-directory. Unlike most extensions, do not require_once this file in LocalSettings.php.
- Apply the patch to MonoBook.php (MonoBook.php will include CustomNavBooks.php)
- To enable the extension, set $wgCustomNavBlocksEnable to true:
-
$wgCustomNavBlocksEnable = true;
[edit] Configuration
After the patch is applied and the extension is enabled, MediaWiki will look for a page called MediaWiki:CustomNavBlocks. This file defines the blocks used in the sidebar and has the following format:
Pagename|title Pagename2|title2
In this example, the first block will be the content of MediaWiki:pagename with the title 'title' and the second block will be the content of MediaWiki:pagename2 with the title 'title2'.
Next, you have to create the special pages and fill them with the content you want in your blocks. In the above example, create MediaWiki:Pagename and MediaWiki:Pagename2. Note that it is not a good idea to use pagenames with spaces, since ambiguities would arise.
[edit] Example
http://vowi.fsinf.at has the extension enabled. The Sidebar-blocks are enabled at http://vowi.fsinf.at/wiki/MediaWiki:CustomNavBlocks, the first block is at http://vowi.fsinf.at/wiki/MediaWiki:CustomBlockNavigation and so on.
[edit] ChangeLog
The code of CustomNavBlocks wasn't changed for ages, but the patches for MonoBook.php change with each version of MediaWiki, since the line-numbers change.
[edit] 1.0.0
- first version documented here
[edit] License
[edit] ToDo
We could change the extension so newlines are used instead of spaces as seperators.

