Template:MainMenu
Line 1: | Line 1: | ||
− | <div style="width:190px;float:right;margin:10px;margin-top:40px;background:white;padding:5px;border:1px solid #000077;font-size:10px;"> | + | __NOEDITSECTION__ |
+ | {{Disclaimer}} | ||
+ | |||
+ | ==Template== | ||
+ | {{Warning|Other Locales|For now, this menu has to be duplicated for each language translation, which is a huge bummer<br>So for now, when you change this menu, change all the other translations of this menu as well}} | ||
+ | |||
+ | |||
+ | {{Note|If you need a sub menu, add it here using the guide below!}} | ||
+ | |||
+ | <onlyinclude><div style="width:190px;float:right;margin:10px;margin-top:40px;background:white;padding:5px;border:1px solid #000077;font-size:10px;"> | ||
<div style="border:solid 1px #A8A8A8;padding-left:0.7em;margin:0.5em 0em;background-color:#EEF3E2;"> | <div style="border:solid 1px #A8A8A8;padding-left:0.7em;margin:0.5em 0em;background-color:#EEF3E2;"> | ||
<span style="font-size:12px;font-weight:bold;">[[Main_Page|Main Page]]</span> | <span style="font-size:12px;font-weight:bold;">[[Main_Page|Main Page]]</span> | ||
Line 49: | Line 58: | ||
* [[CodingStandards|Coding Standards]] | * [[CodingStandards|Coding Standards]] | ||
* [[Special:Categories|Categories]] | * [[Special:Categories|Categories]] | ||
− | </div> | + | </div></onlyinclude> |
+ | |||
+ | This is the Main Menu for our wiki | ||
+ | |||
+ | It uses a template parameter and conditionals to display sub menus<br> | ||
+ | The Roster menu is called like so | ||
+ | <pre>{{MainMenu|Roster}}</pre> | ||
+ | '''MainMenu''' is the name of this template<br> | ||
+ | '''Roster''' is the first parameter | ||
+ | |||
+ | <pre>{{#ifeq:{{{1}}}|Roster| | ||
+ | ** [[SomePage|SomePage]] | ||
+ | |}}</pre> | ||
+ | This is a conditional that determines if we are printing a sub menu | ||
+ | |||
+ | <pre>{{#ifeq:{{{1}}}|Roster|</pre> | ||
+ | This means if the first template parameter equals '''Roster''', then display the sub menu | ||
+ | |||
+ | <pre>|}}</pre> | ||
+ | This closes the conditional | ||
+ | |||
+ | If we want a sub menu in a sub menu, then we use more parameters when calling the template | ||
+ | <pre>{{MainMenu|Roster|Addons}}</pre> | ||
+ | '''MainMenu''' is the name of this template<br> | ||
+ | '''Roster''' is the first parameter<br> | ||
+ | '''Addons''' is the second parameter | ||
+ | |||
+ | <pre>{{#ifeq:{{{1}}}|Roster| | ||
+ | ** [[SomePage|SomePage]] | ||
+ | {{#ifeq:{{{2}}}|Addons| | ||
+ | *** [[AnotherPage|AnotherPage]] | ||
+ | |}} | ||
+ | |}}</pre> |
Revision as of 20:35, 28 July 2007
Important note: When you edit this page, you agree to release your contribution into the public domain. |
Template
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]] |}} |}}