Difference between revisions of "Navigation"
(Tag: Visual edit) |
The main navigation can be found Users with administrator rights can change the menu items in the main navigation.
Contents
Changing the menu items[edit | edit source]
The main navigation is visible to all wiki users. By default, it is on the left side of the wiki page. This bar contains the navigation, every use can see and use (in contrast to the Focus, which can be customized from the user as individual and personal navigation). To change the main navigation, you need to have administrator rights. Besides: in the navigation bar, you can link important areas and portals (like departments or main topics).
Fold navigation in and out
layout. You can always switch to the main navigation by clicking on the associated icon at the top of the navigation bar.
The link Edit sidebar loads the page Mediawiki:Sidebar:
* Navigation
** Main_Page|Main page
** Special:AllPages|From A to Z
* Enterprise
** Company|Company
** Staff|Staff
** Sales and Marketing|Sales, Marketing, Projectmangement
** Products and services|Products
** Category:Organisation|Customers and Organisationen
The menu items are structured as a list:
* = menu header (collapsible)
** = clickable menu item
The syntax for a clickable menu item is Page name|Page label
:
Note: It is not possible to create sub-items in the navigation bar.
**Portal|Portal 
Changing the icons[edit | edit source]
Since the BlueSpice version 2.22.0 you have the possibility to fold the navigation in and out. Just click on the white arrows on top of the navigation bar.


You can assign different icons to each menu item in the main navigation. Let's assume you have a menu item called Quality assurance. The default BlueSpice icon is a page icon:
To change the icon:
- Open the page MediaWiki:Common.css in edit mode.
- Add the following lines to the end of the page and save the page:
#n-Quality-assurance > i:nth-child(1)::before {
content: '\e9a1';
font-family: 'entypo';
}
The icon is now customized to an eye icon:
Reload the page or empty the browser cache if the changes are not immediately visible.
Navigationlinks with special characters[edit | edit source]
You can find the code of the navigation bar on this page:
MediaWiki:Sidebar
You can also go to Special pages -> System messages -> sidebar.
CodingIf the text for the menu items contains special characters, they are converted in the HTML code of the page. In this case, right-click on the corresponding entry and, depending on the browser used, select "Inspect" or similar.
There you can see the underlying source code and should see a line item that has this form:
<a id="n-MENUENTRY" class="list-group-item" ..... >
For example, the German menu item Qualitätssicherung is shown as n-Qualit.C3.A4tssicherung. The selector in Common.css is #n-Qualit.C3.A4tssicherung.
a[id="n-Qualit.C3.A4tssicherung"] > i:nth-child(1)::before {
content: '\e90e';
font-family: 'entypo';
}
Available icons[edit | edit source]
If you take a look at MediaWiki:Sidebar
, you may see that it is a list. * is a header and ** a list item under the header.
The list items are like normal wiki links. The first part after the ** is the name of the page, you want to link to. In normal wiki code, this name is in brackets, e.g. [Testpage]
. You don´t need this brackets here. Just type in the name of the page. The second part after the |
is the description, this means it´s the text which will be shown in the navigation.
Note: It is not possible to create subitems in the navigation bar and also linking to a file doesn´t work, because the Sidebar can´t interpret this kind of links.
Insert icons in the navigation[edit | edit source]
Starting with version 2.22.0 you can add icons. To do this, follow these steps:
- Go to the special page Special:Upload. Upload the icons, you want to use. Note: An icon should have a size of 24px x 24px. Recommended formats are .jpg, .png
- Open the page MediaWiki:Sidebar and put behind the menu item a pipe ("|") and write behind the file name of the icon. Then save.
* Recentchanges-url | Recent Changes | Icon-for-recent-changes.png
- Refresh the page by pressing F5, then should your icons appear in the menu.
You can see all available icons on the page w/extensions/BlueSpiceFoundation/resources/bs.icons.php
of your wiki.
A list with all icons and their character keys on this helpdesk is available here and is the same for any default installation of a BlueSpice wiki.
In the upper line you can click through different fonts, below you find the icons with the corresponding character keys. In MediaWiki:Common.css you have to adjust the entries font-family (entypo, fontawesome, icomoon, ...) and content (character key) accordingly.
Group-specific navigation[edit | edit source]
It is possible to show navigation elements for specific user groups only. Please note that the pipe symbol (|) between the page name and its label has to be escaped as{{!}}
within this function.
{#ifingroup:sysop,widgeteditor |
*Test2
**somepage{{!}}Some page
|}}
Supporting language settings[edit | edit source]
If you want to make sure that your menu items are shown in the language a user has set under Preferences, you need to provide a separate message page for each menu item. These message pages need to reside in the namespace MediaWiki. Since BlueSpice supports English and German (both de and de-formal), you need three language pages for each menu item in the sidebar.
In the following example, we create a menu item called Quality assurance. A user who specified German (de) or formal German (de-formal in their preferences, should see the label Qualitätssicherung instead.
To create the labels in EN, DE and DE-formal:
- Create or edit the page MediaWiki:QA and add the text for the English label (Quality assurance).Save the page.
- Create or edit the page MediaWiki:QA/de and add the text for the German label (Qualitätssicherung).Save the page.
- Create or edit the page MediaWiki:QA/de-formal and add the text for the German label (Qualitätssicherung). Save the page.
-
Create the link on the page MediaWiki:Sidebar:
**About_quality_assurance|QA
This creates a link in the main navigation to the page About quality assurance and displays the label that is located in the different language message pages. To test the languages, go to Preferences > User Profile in your user profile menu. In the section Internationalisation, set the language from English to German or vice versa and save the setting. The language of the menu item now displays in the correct language.
Navigation in multilingual wikis[edit | edit source]
Important! These instructions do not apply in a farm environment or in separate language wikis. These instructions are used for maintaining languages via sub-pages.
If you have content in multiple languages, you want that users with English language preference settings not only see the corresponding menu labels. They should also be directed to the English page when they click on a menu item. Users with German language settings should see the German content after clicking on the German menu link. In this case, you also have to create separate link targets in addition to the language labels.
Note: To avoid having to set up different navigation pages for formal (de-formal) and informal German (de), you can create a policy, which language setting should be used by your users.
In the previous section, we already created the labels when a user switches languages. Now we also have to create different link targets for these pages. If the main language is English and the page is called About quality assurance, the translations can be located in subpages. For example, the German version is located under About quality assurance/de.
To create the link targets to the language pages:
- Create or edit the page MediaWiki:QA-url and add the link to the English page About quality assurance. The link is entered without brackets, in plain text. Save the page.
- Create or edit the page MediaWiki:QA-url/de and add the text for the German page (About quality assurance/de). The link is entered without brackets, in plain text. Save the page.
- Create or edit the page MediaWiki:QA-url/de-formal and add the text for the German page (About quality assurance/de). The link is entered without brackets, in plain text. Save the page.
In the link to the Quality assurance page, change the link from
**About_quality_assurance|QA
to
**QA-url|QA
This achieves the language switch for the target pages (QA-url) and for the label of the menu item.
Depending on the language settings of the user, the user is now directly directed to the correct language version.
Related info
__NOTOC__ The main navigation can be found {{DISPLAYTITLE:Customize the main navigation}} Users with administrator rights can change the menu items in the main navigation. ==Changing the menu items== The main navigation is visible to all wiki users. By default, it is on the left side of the wiki page. This bar contains the navigation, every use can see and use (in contrast to the [[UserSideBar|Focus]], which can be customized from the user as individual and personal navigation). To change the main navigation, you need to have administrator rights. Besides: in the navigation bar, you can link important areas and portals (like departments or main topics). ==Fold navigation in and out== Since the BlueSpice version 2.22.0 you have the possibility to fold the navigation in and out. Just click on the white arrows on top of the navigation bar. {| |- | valign="bottom"|[[File:BlueSpice2-Navigation-ausgeklappt.png|thumb|right|220px|Screenshot: Die ausgeklappte Navigation mit allen Informationen]] | valign="bottom"|[[File:BlueSpice2-Navigation-eingeklappt.png|thumb|right|220px|Screenshot: Die eingeklappte Navigation mit Icons als Hinweis]] |} ==Change the content of the navigation== You can find the code of the navigation bar on this page: <pre>MediaWiki:Sidebar</pre> You can also go to Special pages -> System messages -> sidebar. ===Coding=== If you take a look at <code>MediaWiki:Sidebar</code>, you may see that it is a list. <nowiki>*</nowiki> is a header and <nowiki>**</nowiki> a list item under the header. The list items are like normal wiki links. The first part after the <nowiki>**</nowiki> is the name of the page, you want to link to. In normal wiki code, this name is in brackets, e.g. <code>[Testpage]</code>. You don´t need this brackets here. Just type in the name of the page. The second part after the <code>|</code> is the description, this means it´s the text which will be shown in the navigation. {{Box_Note|Note text = It is not possible to create subitems in the navigation bar and also linking to a file doesn´t work, because the Sidebar can´t interpret this kind of links.}} <!-- ===Nesting=== Die Seiten werden in der Regel per MediaWiki-Systemtextnamen angesprochen, die Hauptseite etwa mit <span class="mceNonEditable tag" id="bs_specialtag:@@@ST3@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="3" >< code ></span> oder die Letzten Änderungen mit <span class="mceNonEditable tag" id="bs_specialtag:@@@ST4@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="4" >< code ></span>. Das heißt, die Linkadressen sind außerhalb der Seite <span class="mceNonEditable tag" id="bs_specialtag:@@@ST5@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="5" >< code ></span> auf einer eigenen Seite im Namensraum MediaWiki notiert. Der wirklichen Links liegen dann zum Beispiel auf der Seite <span class="mceNonEditable tag" id="bs_specialtag:@@@ST6@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="6" >< code ></span> oder auf einer Seite <span class="mceNonEditable tag" id="bs_specialtag:@@@ST7@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="7" >< code ></span>. Der Hintergrund dieser Regelung im MediaWiki ist nicht ganz klar. Wahrscheinlich geht es um eine Konvention für die Vereinfachung der Internationalisierung. ====Beispiel==== Zufälliger Artikel als Unterpunkt von Navigation:<br />Um einen Link zur Spezialseite ''zufälliger Artikel'' in die Navigationsleiste setzen, müssen Sie zunächst nachsehen wie der MediaWiki-Systemtext heißt, in diesem Fall <span class="mceNonEditable tag" id="bs_specialtag:@@@ST8@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="8" >< code ></span>. Um nun einen Unterpunkt zu machen, gehen Sie wie bei einer Liste vor und setzen <span class="mceNonEditable tag" id="bs_specialtag:@@@ST9@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="9" >< code ></span> bzw. <span class="mceNonEditable tag" id="bs_specialtag:@@@ST10@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="10" >< code ></span> an der jeweiligen Stelle und fügen dann <span class="mceNonEditable tag" id="bs_specialtag:@@@ST11@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="11" >< code ></span> ein, danach fehlt nur noch eine Beschreibung, die nach dem <span class="mceNonEditable tag" id="bs_specialtag:@@@ST12@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="12" >< code ></span> eingefügt wird, z.B. <span class="mceNonEditable tag" id="bs_specialtag:@@@ST13@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="13" >< code ></span>. Ihr Unterpunkt ''Zufälliger Artikel'' könnte z.B. so aussehen: <pre>** randompage|Zufälliger Artikel</pre> <br /> --> ==Insert icons in the navigation== Starting with version 2.22.0 you can add icons. To do this, follow these steps: * Go to the special page '''Special:Upload'''. Upload the icons, you want to use. Note: An icon should have a size of 24px x 24px. Recommended formats are .jpg, .png * Open the page '''MediaWiki:Sidebar''' and put behind the menu item a pipe ("|") and write behind the file name of the icon. Then save. <pre> * Recentchanges-url | Recent Changes | Icon-for-recent-changes.png </pre> * Refresh the page by pressing F5, then should your icons appear in the menu. <!-- ==Navigation in mehrsprachigen Wikis== In mehrsprachigen Wikis sollen natürlich nicht nur die Inhalte, sondern auch die Navigation in unterschiedlichen Sprachen verfügbar sein. Um einen neuen Navigationspunkt in MediaWiki anzulegen, benötigen Sie deshalb immer zwei Seiten, auf die die Navigation zurückgreift: * Zum einen eine Seite, die den Link auf die Zielseite enthält * Zum anderen eine Seite, die den Alias Namen, der in der Navigation auftauschen soll enthält ===Ein Beispiel=== '''Sie wollen den Menüpunkt "User manual" anlegen und Ihr Wiki hat als Hauptsprache Englisch.'''1. Legen Sie eine Seite im MediaWiki Namensraum an, die den Menüpunkt widerspiegelt z.B. <pre>MediaWiki:User_manual</pre> Auf dieser Seite gehen Sie auf Bearbeiten und tragen dort den Alias Namen ein, der nachher in der Navigation erscheinen soll, z.B. "User Manual". Speichern Sie die Seite ab.<br /><br />2. Legen Sie eine Seite im MediaWiki Namensraum an, die später den Link enthält. Achtung verwenden Sie denselben Namen wie den vorher angelegten Alias! <pre>MediaWiki:User_manual-url</pre> Auf dieser Seite gehen Sie auf Bearbeiten und tragen dort das Linkziel (d.h. einen Seitenlink) ein. Der Link erscheint später unter dem Alias in der Navigation, z.B. "UserManual". Achtung auf dieser Seite wird der Link ''ohne'' eckige Klammern eingetragen! Speichern Sie die Seite ab.<br /><br />3. Gehen Sie auf die MediaWiki Seite, die für die Navigation verantwortlich ist (Beschreibung s.o.). Hier unter "MediaWiki:Sidebar" tragen Sie nun den neuen Link ein: <pre><nowiki>* User manual-url|User manual</nowiki></pre> Dann erscheint in der Navigation der Aliasname und der Link, den Sie vorher auf den beiden Unterseiten eingetragen haben. <br /><br /> '''Nun möchten Sie die deutsche Entsprechung der Navigation erstellen:'''<br /><br /> 1. Legen Sie die (z.B. deutsche) Unterseite zu der vorher erstellten Alias Seite an: <pre>MediaWiki:User_manual/de</pre> Tragen Sie hier den deutschen Aliasnamen ein: "Nutzerhandbuch"<br /><br /> 2. Legen Sie die Unterseite (z.B. deutsche) Unterseite zu der vorher erstellten Linkseite an: <pre>MediaWiki:User_manual-url/de</pre> Hinterlegen Sie hier den entsprechenden Link auf die deutschsprachige Seite. Achtung, auch hier nur die Zielseite ohne eckige Klammern eintragen. Kommt nun ein deutschsprachiger Nutzer auf ihr Wiki, sieht er in der Naviagtion "Nutzerhandbuch" und wird auf die deutsche Seite geleitet, während der englischsprachige Nutzer "User Manual" sieht und auf die englischsprachige Seite weitergeleitet wird. <br /><br /> '''Zusammenfassend:''' Um einen Link in der Navigation in zwei Sprachen zu hinterlegen, müssen vier neue Seiten erstellt werden und ein Link auf der Seite <span class="mceNonEditable tag" id="bs_specialtag:@@@ST17@@@" data-bs-name="code" data-bs-type="tag" data-bs-id="17" >< code ></span> hinterlegt werden. ==Portal anlegen== Wenn Sie in der Navigationsleiste ein neues Portal anlegen wollen, geben Sie einfach das Linkziel ein: ''Linkziel|Beschriftung''. '''Achtung''': ''portal-url|Themenportale'' greift immer auf das selbe Portal zu. ==Weblinks== * [http://www.mediawiki.org/wiki/Manual:Interface/Sidebar Eintrag im MediaWiki Manual] --> [[Category:MediaWiki]] [[en:{{FULLPAGENAME}}]][[de:Navigation]]layout. You can always switch to the main navigation by clicking on the associated icon at the top of the navigation bar.<br /> [[File:navmenu-top.png|alt=Navigation menu|center|thumb|250x250px|Navigation menu]] To activate the edit link, hover over the last menu item in the main navigation.[[File:navmenu-edit.png|alt=Edit sidebar|center|220x220px|thumb|Edit sidebar]] The link ''Edit sidebar'' loads the page ''Mediawiki:Sidebar:'' <pre>* Navigation ** Main_Page|Main page ** Special:AllPages|From A to Z * Enterprise ** Company|Company ** Staff|Staff ** Sales and Marketing|Sales, Marketing, Projectmangement ** Products and services|Products ** Category:Organisation|Customers and Organisationen </pre>The menu items are structured as a list: <nowiki>*</nowiki> = menu header (collapsible) <nowiki>**</nowiki> = clickable menu item The syntax for a clickable menu item is <code>Page name|Page label</code>: In the navigation example above, the page description ''From A to Z'' links to the page ''Special:AllPages'' .{{Box_Note|Note text = It is not possible to create sub-items in the navigation bar.|boxtype=note}} Link labels may collide with system messages. If this is the case, simply append the HTML-code for an empty space to the description:<syntaxhighlight lang="text"> **Portal|Portal  </syntaxhighlight> [[File:nav-label-system message-conflict.png|alt=Resolving a conflict with system messages|center|thumb|650x650px|Resolving a conflict with system messages]] <br /> ==Changing the icons== You can assign different icons to each menu item in the main navigation. Let's assume you have a menu item called ''Quality assurance''. The default BlueSpice icon is a ''page'' icon: [[File:navmenu-icon.png|alt=Screenshot: Nav menu items|center|170x170px]] '''To change the icon''': <ol> <li>Open the page ''MediaWiki:Common.css'' in edit mode.</li> <li>Add the following lines to the end of the page and save the page:</li> <syntaxhighlight lang="html"> #n-Quality-assurance > i:nth-child(1)::before { content: '\e9a1'; font-family: 'entypo'; } </syntaxhighlight> </ol>Note that the space in the label ''Quality assurance'' has to be replaced with a hyphen (''Quality-assurance''). The icon is now customized to an ''eye'' icon: [[File:navmenu-icon-eye.png|alt=Custom icon|center|170x170px|thumb|Custom icon]] Reload the page or empty the browser cache if the changes are not immediately visible. <br /> ===Navigationlinks with special characters=== If the text for the menu items contains special characters, they are converted in the HTML code of the page. In this case, right-click on the corresponding entry and, depending on the browser used, select "Inspect" or similar. [[File:nav-icon-specialchars.png|alt=Inspect page with Google Chrome|center|thumb|650x650px|Inspect page with Google Chrome]] There you can see the underlying source code and should see a line item that has this form: <pre><a id="n-MENUENTRY" class="list-group-item" ..... ></pre> For example, the German menu item ''Qualitätssicherung'' is shown as ''n-Qualit.C3.A4tssicherung''. The selector in Common.css is ''#n-Qualit.C3.A4tssicherung''.<syntaxhighlight lang="css"> a[id="n-Qualit.C3.A4tssicherung"] > i:nth-child(1)::before { content: '\e90e'; font-family: 'entypo'; } </syntaxhighlight>After saving ''Common.css'' and reloading the page you now see the selected icon. ===Available icons=== You can see all available icons on the page <code>w/extensions/BlueSpiceFoundation/resources/bs.icons.php</code> of your wiki. [https://en.wiki.bluespice.com/w/extensions/BlueSpiceFoundation/resources/bs.icons.php A list with all icons] and their character keys on this helpdesk is available here and is the same for any default installation of a BlueSpice wiki. In the upper line you can click through different fonts, below you find the icons with the corresponding character keys. In ''MediaWiki:Common.css'' you have to adjust the entries ''font-family'' (entypo, fontawesome, icomoon, ...) and ''content'' (character key) accordingly. ==Group-specific navigation== It is possible to show navigation elements for specific user groups only. Please note that the pipe symbol (|) between the page name and its label has to be escaped as <code><nowiki>{{!}}</nowiki></code> within this function.<syntaxhighlight lang="text"> {#ifingroup:sysop,widgeteditor | *Test2 **somepage{{!}}Some page |}} </syntaxhighlight> ==Supporting language settings== If you want to make sure that your menu items are shown in the language a user has set under ''Preferences'', you need to provide a separate message page for each menu item. These message pages need to reside in the namespace ''MediaWiki''. Since BlueSpice supports English and German (both de and de-formal), you need three language pages for each menu item in the sidebar. In the following example, we create a menu item called ''Quality assurance.'' A user who specified German (de) or formal German (de-formal in their preferences, should see the label ''Qualitätssicherung'' instead. '''To create the labels in EN, DE and DE-formal:''' #Create or edit the page ''MediaWiki:QA'' and add the text for the English label (''Quality assurance'').Save the page. #Create or edit the page ''MediaWiki:QA''/''de'' and add the text for the German label (''Qualitätssicherung'').Save the page. #Create or edit the page ''MediaWiki:QA''/''de-formal'' and add the text for the German label (''Qualitätssicherung''). Save the page. #Create the link on the page ''MediaWiki:Sidebar'': <code>**About_quality_assurance|QA</code> This creates a link in the main navigation to the page ''About quality assurance'' and displays the label that is located in the different language message pages. To test the languages, go to ''Preferences > User Profile'' in your user profile menu. In the section ''Internationalisation'', set the language from English to German or vice versa and save the setting. The language of the menu item now displays in the correct language. ==Navigation in multilingual wikis== {{Box Note|boxtype=important|Note text=These instructions do not apply in a farm environment or in separate language wikis. These instructions are used for maintaining languages via sub-pages.}} If you have content in multiple languages, you want that users with English language preference settings not only see the corresponding menu labels. They should also be directed to the English page when they click on a menu item. Users with German language settings should see the German content after clicking on the German menu link. In this case, you also have to create separate link targets in addition to the language labels. {{Box Note|boxtype=note|Note text=To avoid having to set up different navigation pages for formal (de-formal) and informal German (de), you can create a policy, which language setting should be used by your users.}} In the previous section, we already created the labels when a user switches languages. Now we also have to create different link targets for these pages. If the main language is English and the page is called ''About quality assurance,'' the translations can be located in subpages. For example, the German version is located under ''About quality assurance/de''. '''To create the link targets to the language pages:''' #Create or edit the page ''MediaWiki:QA-url'' and add the link to the English page ''About quality assurance''. The link is entered without brackets, in plain text. Save the page. #Create or edit the page ''MediaWiki:QA''-url/''de'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page. #Create or edit the page ''MediaWiki:QA''-url/''de-formal'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page. In the link to the ''Quality assurance'' page, change the link from <code>**About_quality_assurance|QA</code> to <code>**QA-url|QA</code> This achieves the language switch for the target pages (QA-url) and for the label of the menu item.<br /><br />Depending on the language settings of the user, the user is now directly directed to the correct language version.<br /> {{Box Links-en |Topic1=[[Template/Example/Translate| Translation of pages within a wiki]] |Topic2=[[Manual:Extension/BlueSpiceUserSidebar | Personal navigation]]}} [[en:{{FULLPAGENAME}}]] [[De:Navigation]] [[Category:Administration]]
(30 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | + | {{DISPLAYTITLE:Customize the main navigation}} | |
− | |||
− | == | + | Users with administrator rights can change the menu items in the main navigation. |
− | + | ==Changing the menu items== | |
+ | The main navigation is visible to all wiki users. By default, it is on the left side of the wiki layout. You can always switch to the main navigation by clicking on the associated icon at the top of the navigation bar.<br /> | ||
+ | [[File:navmenu-top.png|alt=Navigation menu|center|thumb|250x250px|Navigation menu]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | To activate the edit link, hover over the last menu item in the main navigation.[[File:navmenu-edit.png|alt=Edit sidebar|center|220x220px|thumb|Edit sidebar]] | |
− | + | The link ''Edit sidebar'' loads the page ''Mediawiki:Sidebar:'' | |
− | + | <pre>* Navigation | |
− | + | ** Main_Page|Main page | |
+ | ** Special:AllPages|From A to Z | ||
+ | * Enterprise | ||
+ | ** Company|Company | ||
+ | ** Staff|Staff | ||
+ | ** Sales and Marketing|Sales, Marketing, Projectmangement | ||
+ | ** Products and services|Products | ||
+ | ** Category:Organisation|Customers and Organisationen | ||
+ | </pre>The menu items are structured as a list: | ||
− | + | <nowiki>*</nowiki> = menu header (collapsible) | |
− | + | <nowiki>**</nowiki> = clickable menu item | |
− | |||
− | |||
− | |||
− | + | The syntax for a clickable menu item is <code>Page name|Page label</code>: | |
− | + | In the navigation example above, the page description ''From A to Z'' links to the page ''Special:AllPages'' .{{Box_Note|Note text = It is not possible to create sub-items in the navigation bar.|boxtype=note}} | |
− | |||
− | |||
− | |||
− | + | Link labels may collide with system messages. If this is the case, simply append the HTML-code for an empty space to the description:<syntaxhighlight lang="text"> | |
+ | **Portal|Portal  | ||
+ | </syntaxhighlight> | ||
+ | [[File:nav-label-system message-conflict.png|alt=Resolving a conflict with system messages|center|thumb|650x650px|Resolving a conflict with system messages]] | ||
+ | <br /> | ||
+ | ==Changing the icons== | ||
+ | You can assign different icons to each menu item in the main navigation. Let's assume you have a menu item called ''Quality assurance''. The default BlueSpice icon is a ''page'' icon: | ||
+ | |||
+ | [[File:navmenu-icon.png|alt=Screenshot: Nav menu items|center|170x170px]] | ||
+ | |||
+ | '''To change the icon''': | ||
+ | |||
+ | <ol> | ||
+ | <li>Open the page ''MediaWiki:Common.css'' in edit mode.</li> | ||
+ | <li>Add the following lines to the end of the page and save the page:</li> | ||
+ | <syntaxhighlight lang="html"> | ||
+ | #n-Quality-assurance > i:nth-child(1)::before { | ||
+ | content: '\e9a1'; | ||
+ | font-family: 'entypo'; | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | </ol>Note that the space in the label ''Quality assurance'' has to be replaced with a hyphen (''Quality-assurance''). | ||
+ | |||
+ | The icon is now customized to an ''eye'' icon: | ||
+ | [[File:navmenu-icon-eye.png|alt=Custom icon|center|170x170px|thumb|Custom icon]] | ||
+ | |||
+ | Reload the page or empty the browser cache if the changes are not immediately visible. | ||
− | |||
<br /> | <br /> | ||
− | |||
− | == | + | ===Navigationlinks with special characters=== |
− | + | If the text for the menu items contains special characters, they are converted in the HTML code of the page. In this case, right-click on the corresponding entry and, depending on the browser used, select "Inspect" or similar. | |
+ | [[File:nav-icon-specialchars.png|alt=Inspect page with Google Chrome|center|thumb|650x650px|Inspect page with Google Chrome]] | ||
+ | |||
+ | |||
+ | There you can see the underlying source code and should see a line item that has this form: | ||
+ | <pre><a id="n-MENUENTRY" class="list-group-item" ..... ></pre> | ||
+ | For example, the German menu item ''Qualitätssicherung'' is shown as ''n-Qualit.C3.A4tssicherung''. The selector in Common.css is ''#n-Qualit.C3.A4tssicherung''.<syntaxhighlight lang="css"> | ||
+ | a[id="n-Qualit.C3.A4tssicherung"] > i:nth-child(1)::before { | ||
+ | content: '\e90e'; | ||
+ | font-family: 'entypo'; | ||
+ | } | ||
+ | </syntaxhighlight>After saving ''Common.css'' and reloading the page you now see the selected icon. | ||
+ | |||
+ | ===Available icons=== | ||
+ | You can see all available icons on the page <code>w/extensions/BlueSpiceFoundation/resources/bs.icons.php</code> of your wiki. | ||
+ | |||
+ | [https://en.wiki.bluespice.com/w/extensions/BlueSpiceFoundation/resources/bs.icons.php A list with all icons] and their character keys on this helpdesk is available here and is the same for any default installation of a BlueSpice wiki. | ||
+ | |||
+ | In the upper line you can click through different fonts, below you find the icons with the corresponding character keys. In ''MediaWiki:Common.css'' you have to adjust the entries ''font-family'' (entypo, fontawesome, icomoon, ...) and ''content'' (character key) accordingly. | ||
+ | |||
+ | ==Group-specific navigation== | ||
+ | It is possible to show navigation elements for specific user groups only. Please note that the pipe symbol (|) between the page name and its label has to be escaped as <code><nowiki>{{!}}</nowiki></code> within this function.<syntaxhighlight lang="text"> | ||
+ | {#ifingroup:sysop,widgeteditor | | ||
+ | *Test2 | ||
+ | **somepage{{!}}Some page | ||
+ | |}} | ||
+ | </syntaxhighlight> | ||
+ | ==Supporting language settings== | ||
+ | If you want to make sure that your menu items are shown in the language a user has set under ''Preferences'', you need to provide a separate message page for each menu item. These message pages need to reside in the namespace ''MediaWiki''. Since BlueSpice supports English and German (both de and de-formal), you need three language pages for each menu item in the sidebar. | ||
+ | |||
+ | In the following example, we create a menu item called ''Quality assurance.'' A user who specified German (de) or formal German (de-formal in their preferences, should see the label ''Qualitätssicherung'' instead. | ||
− | + | '''To create the labels in EN, DE and DE-formal:''' | |
− | |||
− | < | + | #Create or edit the page ''MediaWiki:QA'' and add the text for the English label (''Quality assurance'').Save the page. |
− | </ | + | #Create or edit the page ''MediaWiki:QA''/''de'' and add the text for the German label (''Qualitätssicherung'').Save the page. |
+ | #Create or edit the page ''MediaWiki:QA''/''de-formal'' and add the text for the German label (''Qualitätssicherung''). Save the page. | ||
+ | #Create the link on the page ''MediaWiki:Sidebar'': <code>**About_quality_assurance|QA</code> This creates a link in the main navigation to the page ''About quality assurance'' and displays the label that is located in the different language message pages. To test the languages, go to ''Preferences > User Profile'' in your user profile menu. In the section ''Internationalisation'', set the language from English to German or vice versa and save the setting. The language of the menu item now displays in the correct language. | ||
− | + | ==Navigation in multilingual wikis== | |
− | + | {{Box Note|boxtype=important|Note text=These instructions do not apply in a farm environment or in separate language wikis. These instructions are used for maintaining languages via sub-pages.}} | |
− | == | + | If you have content in multiple languages, you want that users with English language preference settings not only see the corresponding menu labels. They should also be directed to the English page when they click on a menu item. Users with German language settings should see the German content after clicking on the German menu link. In this case, you also have to create separate link targets in addition to the language labels. |
− | In | ||
− | + | {{Box Note|boxtype=note|Note text=To avoid having to set up different navigation pages for formal (de-formal) and informal German (de), you can create a policy, which language setting should be used by your users.}} | |
− | |||
− | + | In the previous section, we already created the labels when a user switches languages. Now we also have to create different link targets for these pages. If the main language is English and the page is called ''About quality assurance,'' the translations can be located in subpages. For example, the German version is located under ''About quality assurance/de''. | |
− | ''' | ||
− | + | '''To create the link targets to the language pages:''' | |
− | |||
− | + | #Create or edit the page ''MediaWiki:QA-url'' and add the link to the English page ''About quality assurance''. The link is entered without brackets, in plain text. Save the page. | |
− | + | #Create or edit the page ''MediaWiki:QA''-url/''de'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page. | |
+ | #Create or edit the page ''MediaWiki:QA''-url/''de-formal'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page. | ||
− | + | In the link to the ''Quality assurance'' page, change the link from | |
− | |||
− | |||
− | ''' | ||
− | |||
− | < | + | <code>**About_quality_assurance|QA</code> |
− | |||
− | |||
− | + | to | |
− | |||
− | |||
− | |||
− | |||
− | + | <code>**QA-url|QA</code> | |
− | |||
− | + | This achieves the language switch for the target pages (QA-url) and for the label of the menu item.<br /><br />Depending on the language settings of the user, the user is now directly directed to the correct language version.<br /> | |
+ | {{Box Links-en | ||
+ | |Topic1=[[Template/Example/Translate| Translation of pages within a wiki]] | ||
+ | |Topic2=[[Manual:Extension/BlueSpiceUserSidebar | Personal navigation]]}} | ||
− | + | [[en:{{FULLPAGENAME}}]] | |
− | + | [[De:Navigation]] | |
− | + | [[Category:Administration]] | |
− | |||
− | [[en:{{FULLPAGENAME}}]][[ |