Template:MainMenu
Line 18: | Line 18: | ||
** [[Roster:Requirements|Requirements]] | ** [[Roster:Requirements|Requirements]] | ||
** [[Roster:ChangeLog|Change Log]] | ** [[Roster:ChangeLog|Change Log]] | ||
+ | ** [[Roster:RoadMap|Road Map]] | ||
** [[Roster:Install|Installing Roster]] | ** [[Roster:Install|Installing Roster]] | ||
** [[Roster:FirstUpload|First Upload]] | ** [[Roster:FirstUpload|First Upload]] | ||
Line 67: | Line 68: | ||
** {{#ifexist: Roster:Requirements/{{SUBPAGENAME}}|[[Roster:Requirements/{{SUBPAGENAME}}|Requirements]]|[[Roster:Requirements|Requirements]]}} | ** {{#ifexist: Roster:Requirements/{{SUBPAGENAME}}|[[Roster:Requirements/{{SUBPAGENAME}}|Requirements]]|[[Roster:Requirements|Requirements]]}} | ||
** {{#ifexist: Roster:ChangeLog/{{SUBPAGENAME}}|[[Roster:ChangeLog/{{SUBPAGENAME}}|Change Log]]|[[Roster:ChangeLog|Change Log]]}} | ** {{#ifexist: Roster:ChangeLog/{{SUBPAGENAME}}|[[Roster:ChangeLog/{{SUBPAGENAME}}|Change Log]]|[[Roster:ChangeLog|Change Log]]}} | ||
+ | ** {{#ifexist: Roster:RoadMap/{{SUBPAGENAME}}|[[Roster:RoadMap/{{SUBPAGENAME}}|Road Map]]|[[Roster:RoadMap|Road Map]]}} | ||
** {{#ifexist: Roster:Install/{{SUBPAGENAME}}|[[Roster:Install/{{SUBPAGENAME}}|Installing Roster]]|[[Roster:Install|Installing Roster]]}} | ** {{#ifexist: Roster:Install/{{SUBPAGENAME}}|[[Roster:Install/{{SUBPAGENAME}}|Installing Roster]]|[[Roster:Install|Installing Roster]]}} | ||
** {{#ifexist: Roster:FirstUpload/{{SUBPAGENAME}}|[[Roster:FirstUpload/{{SUBPAGENAME}}|First Upload]]|[[Roster:FirstUpload|First Upload]]}} | ** {{#ifexist: Roster:FirstUpload/{{SUBPAGENAME}}|[[Roster:FirstUpload/{{SUBPAGENAME}}|First Upload]]|[[Roster:FirstUpload|First Upload]]}} |
Revision as of 05:14, 18 November 2008
Important note: When you edit this page, you agree to release your contribution into the public domain. |
Template
Syntax
This is the Main Menu for our wiki
It uses a template parameter and conditionals to display sub menus
The Roster menu is called like so
{{MainMenu|Roster}}
MainMenu is the name of this template
Roster is the first parameter
{{#ifeq:{{{1}}}|Roster| ** [[SomePage|SomePage]] |}}
This is a conditional that determines if we are printing a sub menu
{{#ifeq:{{{1}}}|Roster|
This means if the first template parameter equals Roster, then display the sub menu
|}}
This closes the conditional
If we want a sub menu in a sub menu, then we use more parameters when calling the template
{{MainMenu|Roster|Addons}}
MainMenu is the name of this template
Roster is the first parameter
Addons is the second parameter
{{#ifeq:{{{1}}}|Roster| ** [[SomePage|SomePage]] {{#ifeq:{{{2}}}|Addons| *** [[AnotherPage|AnotherPage]] |}} |}}
The Other Locale Duplicate
To make the menu keep linking to the same language, we copy the menu once and add "/{{SUBPAGENAME}}" to the link
This will make the menu link to the pages in the menu, keeping the same locale
If the page does not exist for that locale, then it should link to the English version
The syntax for this is quite complex as we detect if the translated page exists
Each link needs to look like this:
{{#ifexist: PageName/{{SUBPAGENAME}}|[[PageName/{{SUBPAGENAME}}|Page Name Text]]|[[PageName|Page Name Text]]}}
Some links need to stay linked to the English version, such as the Coding Standards, The Team, and the AddOn SDK
These page may be changed on every release version of our software or even between versions