Extension:SideBarMenu

The SideBarMenu extension allows the creation of multilevel menus through the tag

Die NavigationsleistenMenü-Erweiterungen ermöglichen das Erstellen eines Menüs mit mehreren Ebenen mit dem tag

Installation
Download and install using Composer or ExtensionInstaller, as of c1730 this is the only way of installing and running this extension (however not verified).

Styling
You can use CSS to customize the appearance of the sidebar and override the default CSS styles. To get started take a look in the file /css/ext.sidebarmenu.css.

You can also override css styles on a per menu item level. The styles will attach itself to the  tag. You can override css styles in two ways:
 * 1) using the style parameter. e.g **MenuItem|style=font-weight:bold;font-size:16px;
 * 2) using the class parameter. e.g **MenuItem|class=some-defined-css-class another-css-class

As a late addition, you can also set the class property on the sidebarmenu tag to add custom classes to the root container of the sidebarmenu. This way you can create your own stylesheet and have several sidebarmenu's with their own styling.

Example:  +MyMenuElement1
 * MyMenuElement2

Through this method you could make the sidebarmenu look completely different.

Syntax explanation

 * Each newline represents a new menu item.
 * The first character of a line (either '+' or '-') determines if the menu item's children are visible or hidden
 * The number of '*' characters determines where in the tree the menu item should be placed.
 * A '@' prefix of a menu item, makes that menu item clickable which in turn expands or collapses submenu.
 * The rest of the line is interpreted as wikitext.
 * The input also accepts other mediawiki syntax, e.g
 * #subpage would render a tree of subpages in the sidebarmenu.

#subpage
Given that the wiki is configured with $wgNamespacesWithSubpages, and that the pages A, A/B, and A/B/C exists. A syntax of:


 * 1) subpage A

Would be the equivalent of:

A|A
 * B
 * C

The -/+ syntax can be used on the subpage functionality to give each element a prefix of +/- in the entire subtree.

See also: https://gerrit.wikimedia.org/r/#/c/90536/

Example syntax
MenuItem1                  <-- root menu item +@MenuItem2                <-- new root menu item which has it's children visible (also clickable) -*Child1                   <-- child of MenuItem1 which has it's children hidden <-- Wiki code that is evaluated, in this case a template inclusion
 * Child1                    <-- child of MenuItem1
 * Child2                   <-- child of Child1
 * Child3                    <-- child of MenuItem1
 * Child2                   <-- child of Child1
 * subpage A                <-- child of MenuItem1 which populates the tree with the page A and it's subpages

'+' or '-' determines whether the menu item should be expanded or collapsed, if neither is supplied at the beginning of a line then the default configured ('expanded') will decide.

The number of '*' characters determines the location in the hierarchy for the menuitem.

Note that wiki code evaluation needs to return a valid sidebarmenu syntax.

Example usage
The following code;

will result in the following (not entirely true as some changes has been made to the sourcecode):  (Tip: You can now also give each menu item a different display name e.g Monster truck would display "Monster truck" instead of "Monster_Truck")