Template:MainMenu
m (Changed links to AddonSDK and PluginSDK in other locale menu so they are now linked also to the localized site) |
|||
(55 intermediate revisions by 4 users not shown) | |||
Line 3: | Line 3: | ||
==Template== | ==Template== | ||
− | {{Warning|Other Locales|For now, this menu has to be duplicated for | + | {{Warning|Other Locales|For now, this menu has to be made for English, then duplicated once for other languages, which is a huge bummer<br>So for now, when you change this menu, make sure you scroll down and change the duplicate}} |
− | + | ||
{{Note|If you need a sub menu, add it here using the guide below!}} | {{Note|If you need a sub menu, add it here using the guide below!}} | ||
− | <onlyinclude | + | <onlyinclude> |
− | <div | + | <div class="wowroster-menu"> |
− | < | + | <h5>[[Main_Page|Main Page]]</h5> |
− | < | + | <div class="body"> |
+ | {{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}| | ||
+ | <!-- BEGIN ENGLISH MENU --> | ||
* [[Roster]] | * [[Roster]] | ||
{{#ifeq:{{{1}}}|Roster| | {{#ifeq:{{{1}}}|Roster| | ||
** [[Roster:Requirements|Requirements]] | ** [[Roster:Requirements|Requirements]] | ||
** [[Roster:ChangeLog|Change Log]] | ** [[Roster:ChangeLog|Change Log]] | ||
− | ** [[Roster: | + | ** [[Roster:RoadMap|Road Map]] |
+ | ** [[Roster:Install|Install]] | ||
** [[Roster:FirstUpload|First Upload]] | ** [[Roster:FirstUpload|First Upload]] | ||
** [[Roster:CP|Control Panel]] | ** [[Roster:CP|Control Panel]] | ||
− | ** [[Roster:RosterDiag| | + | ** [[Roster:RosterDiag|Diagnostics]] |
− | ** [[Roster:Menu| | + | ** [[Roster:Menu|Main Menu]] |
− | ** [[Roster:Updating|Updating Character | + | ** [[Roster:Updating|Updating Guild / Character Data]] |
− | ** [[Roster:Addon| | + | ** [[Roster:Addon|Addons]] ([[AddonSDK|AddOn SDK]]) |
− | ** [[Roster: | + | ** [[Roster:Plugins|Plugins]] ([[PluginSDK|Plugin SDK]]) |
+ | ** [[Roster:FunctionsOverview|Functions Overview]] | ||
+ | ** [[Roster:API|Roster API]] | ||
+ | ** [[Roster:Port|CMS Integration]] | ||
{{#ifeq: {{{2}}}|Port| | {{#ifeq: {{{2}}}|Port| | ||
*** [[Roster:Port:WoWRosterDF|WoWRosterDF]] | *** [[Roster:Port:WoWRosterDF|WoWRosterDF]] | ||
Line 32: | Line 37: | ||
** [[UniUploader:BasicSetup|Basic Setup]] | ** [[UniUploader:BasicSetup|Basic Setup]] | ||
** [[UniUploader:Advanced|Advanced Techniques]] | ** [[UniUploader:Advanced|Advanced Techniques]] | ||
− | |||
** [[UniUploader:Distribution|Distribution]] | ** [[UniUploader:Distribution|Distribution]] | ||
|}} | |}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* [[UniAdmin]] | * [[UniAdmin]] | ||
{{#ifeq:{{{1}}}|UniAdmin| | {{#ifeq:{{{1}}}|UniAdmin| | ||
** [[UniAdmin:Help|Help]] | ** [[UniAdmin:Help|Help]] | ||
|}} | |}} | ||
− | * [[WoWAddon]] | + | * [[WoWAddon|WoW Game Addons]] |
{{#ifeq:{{{1}}}|WoWAddon| | {{#ifeq:{{{1}}}|WoWAddon| | ||
− | ** [[ | + | ** [[WoWRosterProfiler]] |
− | ** [[ | + | ** [[WoWRoster-GP]] |
− | ** [[ | + | ** [[PvPLog]] |
{{#ifeq: {{{2}}}|PvPLog| | {{#ifeq: {{{2}}}|PvPLog| | ||
*** [[PvPLog:Changes|Change Log]] | *** [[PvPLog:Changes|Change Log]] | ||
Line 56: | Line 53: | ||
|}} | |}} | ||
|}} | |}} | ||
− | * [[ | + | * [[SVN|Google Code SVN]] |
+ | {{#ifeq:{{{1}}}|SVN| | ||
+ | ** [[SVN:Rules|Rules]] | ||
+ | ** [[SVN:Repositories|Repositories]] | ||
+ | ** [[SVN:TortoiseSVN|TortoiseSVN Help]] | ||
+ | |}} | ||
+ | * [[MYSQL_Guide|MySQL Guide]]| | ||
+ | <!-- BEGIN OTHER LOCALE MENU --> | ||
+ | * {{MainMenuL|Roster|Roster}} | ||
+ | {{#ifeq:{{{1}}}|Roster| | ||
+ | ** {{MainMenuL|Roster:Requirements|Requirements}} | ||
+ | ** [[Roster:ChangeLog|Change Log]] | ||
+ | ** {{MainMenuL|Roster:RoadMap|Road Map}} | ||
+ | ** {{MainMenuL|Roster:Install|Install}} | ||
+ | ** {{MainMenuL|Roster:FirstUpload|First Upload}} | ||
+ | ** {{MainMenuL|Roster:CP|Control Panel}} | ||
+ | ** {{MainMenuL|Roster:RosterDiag|Diagnostics}} | ||
+ | ** {{MainMenuL|Roster:Menu|Main Menu}} | ||
+ | ** {{MainMenuL|Roster:Updating|Updating Guild / Character Data}} | ||
+ | ** {{MainMenuL|Roster:Addon|Addons}} ({{MainMenuL|AddonSDK|AddOn SDK}}) | ||
+ | ** {{MainMenuL|Roster:Plugins|Plugins}} ({{MainMenuL|PluginSDK|Plugin SDK}}) | ||
+ | ** [[Roster:FunctionsOverview|Functions Overview]] | ||
+ | ** {{MainMenuL|Roster:API|Roster API}} | ||
+ | ** {{MainMenuL|Roster:Port|CMS Integration}} | ||
+ | {{#ifeq: {{{2}}}|Port| | ||
+ | *** {{MainMenuL|Roster:Port:WoWRosterDF|WoWRosterDF}} | ||
+ | |}} | ||
+ | |}} | ||
+ | * {{MainMenuL|UniUploader|UniUploader}} | ||
+ | {{#ifeq:{{{1}}}|UniUploader| | ||
+ | ** {{MainMenuL|UniUploader:BasicSetup|Basic Setup}} | ||
+ | ** {{MainMenuL|UniUploader:Advanced|Advanced Techniques}} | ||
+ | ** {{MainMenuL|UniUploader:Distribution|Distribution}} | ||
+ | |}} | ||
+ | * {{MainMenuL|UniAdmin|UniAdmin}} | ||
+ | {{#ifeq:{{{1}}}|UniAdmin| | ||
+ | ** {{MainMenuL|UniAdmin:Help|Help}} | ||
+ | |}} | ||
+ | * {{MainMenuL|WoWAddon|WoW Game Addons}} | ||
+ | {{#ifeq:{{{1}}}|WoWAddon| | ||
+ | ** {{MainMenuL|WoWRosterProfiler|WoWRosterProfiler}} | ||
+ | ** {{MainMenuL|WoWRoster-GP|WoWRoster-GP}} | ||
+ | ** {{MainMenuL|PvPLog|PvPLog}} | ||
+ | {{#ifeq: {{{2}}}|PvPLog| | ||
+ | *** [[PvPLog:Changes|Change Log]] | ||
+ | *** [[PvPLog:TODO|TODO]] | ||
+ | |}} | ||
+ | |}} | ||
+ | * {{MainMenuL|SVN|Google Code SVN}} | ||
+ | {{#ifeq:{{{1}}}|SVN| | ||
+ | ** {{MainMenuL|SVN:Rules|Rules}} | ||
+ | ** {{MainMenuL|SVN:Repositories|Repositories}} | ||
+ | ** {{MainMenuL|SVN:TortoiseSVN|TortoiseSVN Help}} | ||
+ | |}} | ||
+ | * {{MainMenuL|MYSQL_Guide|MySQL Guide}} | ||
+ | }} | ||
+ | * [http://www.wowroster.net/the-team.html The WR.net Team] | ||
* [[CodingStandards|Coding Standards]] | * [[CodingStandards|Coding Standards]] | ||
* [[Special:Categories|Categories]] | * [[Special:Categories|Categories]] | ||
− | |||
− | |||
+ | </div></div> | ||
+ | __TOC__ | ||
+ | </onlyinclude> | ||
+ | |||
+ | ==Syntax== | ||
This is the Main Menu for our wiki | This is the Main Menu for our wiki | ||
Line 93: | Line 149: | ||
|}} | |}} | ||
|}}</pre> | |}}</pre> | ||
+ | |||
+ | ==The Other Locale Duplicate== | ||
+ | To make the menu keep linking to the same language, we copy the menu once and add "/<nowiki>{{SUBPAGENAME}}</nowiki>" to the link<br> | ||
+ | This will make the menu link to the pages in the menu, keeping the same locale<br> | ||
+ | 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<br> | ||
+ | That is why a template is used to enter menu links | ||
+ | |||
+ | <pre>[[PageName|Page Name Text]]</pre> | ||
+ | Becomes | ||
+ | <pre>{{MainMenuL|PageName|Page Name Text}}</pre> | ||
+ | |||
+ | Some links need to stay linked to the English version, such as the Coding Standards, The Team, and the AddOn SDK<br> | ||
+ | These page may be changed on every release version of our software or even between versions |
Latest revision as of 18:12, 5 June 2012
Important note: When you edit this page, you agree to release your contribution into the public domain. |
Template
Contents |
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
That is why a template is used to enter menu links
[[PageName|Page Name Text]]
Becomes
{{MainMenuL|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