Mlink-rodrigue (talk | contribs)
Created page with " The Menu editor allows you to edit the Main navigation menu types '''MediaWiki sidebar''' and Enhanced '''MediaWiki sidebar'''. It is also used in the Book editor. == MediaWiki sidebar == If your navigation is set to MediaWiki sidebar, hover over its last navigation link. An edit icon appears. File:Extension MenuEditor edit icon.png|alt=visible edit icon of the MediaWik..."
 
Mlink-rodrigue (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
[[File:Extension MenuEditor edit icon.png|alt=visible edit icon of the MediaWiki sidebar|center|thumb|150x150px|Edit icon]]
[[File:Extension MenuEditor edit icon.png|alt=visible edit icon of the MediaWiki sidebar|center|thumb|150x150px|Edit icon]]


​If the sidebar page MediaWiki:Sidebar does not exist yet, simply create it.
[[File:MenuEditor menu does not exist.png|alt=Alert that the menu does not exist yet|center|thumb|600x600px|Create the sidebar page]]


'''To add a new heading''':
It usually shows a set of "Getting started" links. The menu element is called navigation. You can delete it together with its default links or leave it available for your users.
[[File:MenuEditor getting started links.png|alt=edit menu for the default navigation links|center|thumb|600x600px|"Getting started" menu]]


# '''Click''' ''Add element''.[[File:Manual:Manual_Extension_MenuEditor_1750412382223.png|center|alt=Add menu heading|thumb|500x500px|Add menu heading]]
== Add a menu section ==
# '''Enter''' the text for the heading. Note: In a multilingual wiki, enter a [[mediawikiwiki:Help:System_message|system message]] here.
# Click '''Add element'''.[[File:Manual_Extension_MenuEditor_1750412382223.png|center|alt=Add menu heading|thumb|500x500px|Add menu heading]]
 
# Enter the text for the menu header. [[File:Manual_Extension_MenuEditor_1750412334804.png|center|alt=Text for menu heading|thumb|500x500px|Text for menu heading]]
[[File:Manual:Manual_Extension_MenuEditor_1750412334804.png|center|alt=Text for menu heading|thumb|500x500px|Text for menu heading]]
# Click on the hamburger menu of the heading.[[File:Manual_Extension_MenuEditor_1750412543194.png|center|alt=Add link as sub element|thumb|500x500px|Add link as sub element]]
'''Add links:'''
# Select '''Add sub element'''.
 
# Enter the '''Link target''' (page name) and the '''Link label'''.[[File:Manual_Extension_MenuEditor_1750412644530.png|center|alt=Create link|thumb|500x500px|Create link]]
# '''Click''' on the hamburger menu next to the heading.
# After adding all links, save the page.
# '''Select''' ''Add sub element''.[[File:Manual:Manual_Extension_MenuEditor_1750412543194.png|center|alt=Add link as sub element|thumb|500x500px|Add link as sub element]]
Refresh your page or navigate to the Main Page to see the updated sidebar.
# '''Enter''' the link target (page name) and the link designation (label).[[File:Manual:Manual_Extension_MenuEditor_1750412644530.png|center|alt=Create link|thumb|500x500px|Create link]]
# '''Click''' on ''Done''.
# '''Repeat''' steps 1-3.
# '''Click''' ''Save''.
 
=== Enhanced MediaWiki sidebar ===
First, you need to set the main navigation to show the ''Enhanced MediaWiki sidebar'' in the [[Manual:Extension/BlueSpiceConfigManager#BlueSpiceDiscovery|configuration manager]].
 
This view shows a fully customizable multi-hierarchical menu.
 
Here, you edit the page MediaWiki:Sidebar.json. It has the basic functionality of the [[Manual:Extension/MenuEditor#MediaWiki sidebar|standard MediaWiki sidebar]]. In addition, it distinguishes between the following sub elements (=node types):
 
* '''Internal Link''': Simply provide a link to a wiki page with an additional link label. Both the page name and/or label can be created by using a parser function.[[File:EnhancedMenuEditor-internal_link.png|center|alt=Internal link with a variable.|thumb|550x550px|Internal link with a variable.]]
* '''External Link''': Same as internal link, but you need to provide a full url to an external website.
* '''Subpage tree''': You can provide the name of a page that has one or more levels of subpages. You can set the depth <code>6</code> levels deep. This means, that if you want to show the first level of subpages, you would select a depth of <code>2</code>. A depth of <code>1</code> only shows the selected page itself.
 
[[File:EnhancedMenuEditor-subpage_tree.png|center|alt=Screenshot of the edit window for a subpage tree item.|thumb|550x550px|Creating a subpage tree with the Enhanced MenuEditor.]]
{{Textbox|boxtype=important|header=|text=You cannot use the same link label twice for different subpage trees, because the expand/collapse functionality will break.|icon=yes}}
It is not possible to change the node type (=item type) after creating it. Instead, create a new item as needed and delete the unwanted item.
 
==== Show for groups ====
In addition, the visibility of a menu item can be limited to certain wiki groups. Enter a comma-separated list of existing wiki groups in the "Show for groups" field.
 
Note: Technically savvy users can, if necessary, "convert" the group constraint into a namespace constraint. However, this "conversion" is not reflected in the GUI mode of the menu editor and should therefore be used with caution. Technically, however, it would be possible to make the change as follows:
 
# First, create a group constraint for an element. For the element you want to show based on namespace, find the group restriction in the JSON source code:<syntaxhighlight lang="json">
{
"type": "enhanced-sidebar-panel-heading",
"text": "test",
"hidden": "{{#ifeq: sysop|false|true}}",
"classes": [],
"icon-cls": ""
}
</syntaxhighlight>
# Change the value of the "hidden" key to the following parser function, where <code>Test</code> is the name of the namespace in which this element should be displayed:<syntaxhighlight lang="json">
{
"type": "enhanced-sidebar-panel-heading",
"text": "test",
"hidden": "{{#ifeq: {{NAMESPACE}}|Test|false|true}}",
"classes": [],
"icon-cls": ""
}
</syntaxhighlight>
# Test the logic in the appropriate namespace.
 
==== Css classes ====
You can also apply css classes to any item for custom styling options. The styles need to be defined on the page <code>MediaWiki:Common.css.</code>
 
== Edit other menus ==
The following menus are also edited with the menu editor:
 
* [[Manual:Extension/BlueSpiceUserSidebar|Personal user menu]]
* [[Manual:Extension/BlueSpiceCustomMenu|Additional menu]]
* [[Manual:Extension/BlueSpiceDiscovery/Footer|Footer menu]]
 
=== Visual editing mode ===
'''Click''' ''Edit'' to switch to edit mode.
 
'''To add a new menu heading:'''
 
# '''Click''' ''Add new element.''
# '''Enter''' the text for your menu header. In a multilingual wiki, you can also enter a [[mediawikiwiki:Help:System_message|message key]].
 
{{#dpl: title=Manual:Extension/BlueSpiceDiscovery/Main_navigation|include=menulinks}}
 
=== Source editing mode ===
'''Click''' ''Edit'' source to switch to source edit mode.
 
Entries starting with a single star ("*") create menu headings or sections while entries with two stars ("**") create links.<pre>
* Bookmarks
** Wiki_Page1|Label
** https://externallink.com|Label
</pre>{{Box Links-en|Topic1=[[Manual:Menus_-_Overview|Menu overview]]|Topic2=|Topic3=}}

Latest revision as of 16:38, 12 November 2026

GlacierSkySapphire


The Menu editor allows you to edit the Main navigation menu types MediaWiki sidebar and Enhanced MediaWiki sidebar. It is also used in the Book editor.

MediaWiki sidebar

If your navigation is set to MediaWiki sidebar, hover over its last navigation link. An edit icon appears.

visible edit icon of the MediaWiki sidebar
Edit icon

​If the sidebar page MediaWiki:Sidebar does not exist yet, simply create it.

Alert that the menu does not exist yet
Create the sidebar page

It usually shows a set of "Getting started" links. The menu element is called navigation. You can delete it together with its default links or leave it available for your users.

edit menu for the default navigation links
"Getting started" menu

Add a menu section

  1. Click Add element.
    Add menu heading
    Add menu heading
  2. Enter the text for the menu header.
    Text for menu heading
    Text for menu heading
  3. Click on the hamburger menu of the heading.
    Add link as sub element
    Add link as sub element
  4. Select Add sub element.
  5. Enter the Link target (page name) and the Link label.
    Create link
    Create link
  6. After adding all links, save the page.

Refresh your page or navigate to the Main Page to see the updated sidebar.