MediaWiki extensions manual
OOjs UI icon alert-invert.svg
Release status: unstable
Implementation Skin
Description Allows you to use normal MediaWiki-pages as contents of your Sidebar
Author(s) MathiasErtltalk
Latest version 2.2.2 (2015-01-15)
MediaWiki 1.27.x -1.31.x
Composer mediawiki/custom-nav-blocks
License GNU General Public License 3.0 or later
Example in VoWi
Check usage and version matrix.

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 ('----') as a separator in the first block.


  • Download, extract and place the file(s) in a directory called CustomNavBlocks in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    require_once "$IP/extensions/CustomNavBlocks/CustomNavBlocks.php";
    $wgCustomNavBlocksEnable = true;
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


After 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:


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'. Please note that each line must not have more than one pipe ("|").

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.


http://vowi.fsinf.at has the extension enabled. The Sidebar-blocks are defined at MediaWiki:CustomNavBlocks, the first block is at MediaWiki:CustomBlockNavigation and so on.

Horizontal rows and the Vector skinEdit

The Vector skin doesn't look very good when a block contains a ----, which translates to a HTML element. To make good looking horizontal rows, that integrate well with the skin, we used CSS. First, no longer use WikiMarkup in your NavBlock:

first subsection
<div id="customnavblocks-subsection">
this section will have a <hr> above.

Then add the following CSS to MediaWiki:Monobook.css:

#customnavblocks-subsection {
    border-top: 1px solid #aaa;
    margin-top: 0.1em;

... and MediaWiki:Vector.css:

#customnavblocks-subsection {
    background-position: left top;
    background-repeat: no-repeat;
    font-size: 0.75em;
    padding-top: 0.1em;

... note that you will have to change the URL to the one your wiki uses.


My wiki displays the normal sidebarEdit
  • Have you checked that you have included CustomNavBlocks.php in LocalSettings.php and set $wgCustomNavBlocksEnable to true? The Installation-chapter has a code-snippet that should work almost everywhere.
  • Does any line in MediaWiki:CustomNavBlocks contain more than one pipe ("|")?
  • Do all the pages defined in MediaWiki:CustomNavBlocks exist? If any page does not exist, the normal sidebar will be displayed.
upper-case block-titlesEdit

The MediaWiki-CSS (at least for the MonoBook skin) defines the titles of a block to be in lower-case. To override this behavior, edit MediaWiki:Common.css to include these lines:

.portlet h5 {
   text-transform: none;

You can of course set the text-transform property to any of the valid values.


GPL 3.0 or later.

Sites Using this ExtensionEdit