Template:MainMenu

From WoWRosterWiKi
(Difference between revisions)
Jump to: navigation, search
m (Changed links to AddonSDK and PluginSDK in other locale menu so they are now linked also to the localized site)
 
(16 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
==Template==
 
==Template==
 
{{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}}
 
{{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><div style="width: 195px; float: right; margin: 10px; margin-top: 40px; background: white; padding: 0 2px 2px; border: 1px solid #000077; font-size: 11px;"><div style="border: solid 1px #a8a8a8; padding: 2px 0 1px 0.7em; margin: 2px 0 0; background-color: #dddddd;"><span style="font-size: 13px; font-weight: bold;">[[Main_Page|Main Page]]</span></div>
+
<onlyinclude>
 +
<div class="wowroster-menu">
 +
<h5>[[Main_Page|Main Page]]</h5>
 +
<div class="body">
 
{{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}|
 
{{#ifeq:{{SUBPAGENAME}}|{{BASEPAGENAME}}|
 
<!--  BEGIN ENGLISH MENU -->
 
<!--  BEGIN ENGLISH MENU -->
Line 23: Line 25:
 
** [[Roster:Updating|Updating Guild / Character Data]]
 
** [[Roster:Updating|Updating Guild / Character Data]]
 
** [[Roster:Addon|Addons]] ([[AddonSDK|AddOn SDK]])
 
** [[Roster:Addon|Addons]] ([[AddonSDK|AddOn SDK]])
 +
** [[Roster:Plugins|Plugins]] ([[PluginSDK|Plugin SDK]])
 
** [[Roster:FunctionsOverview|Functions Overview]]
 
** [[Roster:FunctionsOverview|Functions Overview]]
 +
** [[Roster:API|Roster API]]
 
** [[Roster:Port|CMS Integration]]
 
** [[Roster:Port|CMS Integration]]
 
{{#ifeq: {{{2}}}|Port|
 
{{#ifeq: {{{2}}}|Port|
Line 68: Line 72:
 
** {{MainMenuL|Roster:Menu|Main Menu}}
 
** {{MainMenuL|Roster:Menu|Main Menu}}
 
** {{MainMenuL|Roster:Updating|Updating Guild / Character Data}}
 
** {{MainMenuL|Roster:Updating|Updating Guild / Character Data}}
** {{MainMenuL|Roster:Addon|Addons}} ([[AddonSDK|AddOn SDK]])
+
** {{MainMenuL|Roster:Addon|Addons}} ({{MainMenuL|AddonSDK|AddOn SDK}})
 +
** {{MainMenuL|Roster:Plugins|Plugins}} ({{MainMenuL|PluginSDK|Plugin SDK}})
 
** [[Roster:FunctionsOverview|Functions Overview]]
 
** [[Roster:FunctionsOverview|Functions Overview]]
 +
** {{MainMenuL|Roster:API|Roster API}}
 
** {{MainMenuL|Roster:Port|CMS Integration}}
 
** {{MainMenuL|Roster:Port|CMS Integration}}
 
{{#ifeq: {{{2}}}|Port|
 
{{#ifeq: {{{2}}}|Port|
Line 87: Line 93:
 
* {{MainMenuL|WoWAddon|WoW Game Addons}}
 
* {{MainMenuL|WoWAddon|WoW Game Addons}}
 
{{#ifeq:{{{1}}}|WoWAddon|
 
{{#ifeq:{{{1}}}|WoWAddon|
** {{MainMenuL|WoWRosterProfiler}}
+
** {{MainMenuL|WoWRosterProfiler|WoWRosterProfiler}}
** {{MainMenuL|WoWRoster-GP}}
+
** {{MainMenuL|WoWRoster-GP|WoWRoster-GP}}
** {{MainMenuL|PvPLog}}
+
** {{MainMenuL|PvPLog|PvPLog}}
 
{{#ifeq: {{{2}}}|PvPLog|
 
{{#ifeq: {{{2}}}|PvPLog|
 
*** [[PvPLog:Changes|Change Log]]
 
*** [[PvPLog:Changes|Change Log]]
Line 107: Line 113:
 
* [[Special:Categories|Categories]]
 
* [[Special:Categories|Categories]]
  
</div></onlyinclude>
+
</div></div>
 +
__TOC__
 +
</onlyinclude>
  
 
==Syntax==
 
==Syntax==
Line 147: Line 155:
 
If the page does not exist for that locale, then it should link to the English version
 
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
+
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
  
Each link needs to look like this:
+
<pre>[[PageName|Page Name Text]]</pre>
<pre>{{#ifexist: PageName/{{SUBPAGENAME}}|[[PageName/{{SUBPAGENAME}}|Page Name Text]]|[[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>
 
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
 
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

WR.net

Important note: When you edit this page, you agree to release your contribution into the public domain.
If you do not want this or can not do this because of license restrictions, please do not edit.

Template

Warning.png Other Locales: For now, this menu has to be made for English, then duplicated once for other languages, which is a huge bummer
So for now, when you change this menu, make sure you scroll down and change the duplicate
Info.png Note: If you need a sub menu, add it here using the guide below!


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

Personal tools
Namespaces
Variants
Actions
WoWRoster
Navigation
Toolbox