Template:Navbox: Difference between revisions

From Ukikipedia
Jump to navigation Jump to search
(Ripping straight from tf2 wiki)
 
(Added a description for the usage and added to the Navbox and formatting templates)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!--
<!--


Please do not edit without discussion first as this is a VERY complex template.
Please do not edit without discussion first as this is a VERY complex template.


-->{{#switch:{{{border|{{{1|}}}}}}|subgroup|child={{#if:{{{vtabs|}}}||</div>}}|none=|#default=<table class="navbox {{{bodyclass|}}}" cellspacing="0" <!--
-->{{#switch:{{{border|{{{1|}}}}}}|subgroup|child={{#if:{{{vtabs|}}}||</div>}}|none=|#default=<table class="navbox {{{bodyclass|}}}" cellspacing="0" <!--
  -->style="{{{bodystyle|}}};{{lang|ar=text-direction:{{{text-direction|rtl}}}|en=}};{{{style|}}}"><tr><td style="padding:2px;">}}<!--
  -->style="{{{bodystyle|}}};{{{style|}}}"><tr><td style="padding:2px;">}}<!--


--><table cellspacing="0" class="nowraplinks {{#if:{{{title|}}}|{{#switch:{{{state|}}}|plain|off=|<!--
--><table cellspacing="0" class="nowraplinks {{#if:{{{title|}}}|{{#switch:{{{state|}}}|plain|off=|<!--
Line 34: Line 37:


---Above---
---Above---
-->{{#if:{{{above|}}}|<!--
-->{{#if:{{{above1|}}}|<!--
  -->{{#if:{{{title|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
  -->{{#if:{{{title|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
  --><tr><td class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" <!--
  --><tr><td class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" <!--
  -->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}">{{{above}}}</td></tr>}}<!--
  -->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}">{{{above1}}}</td></tr>}}<!--




Line 76: Line 79:


---Remaining groups/lists---
---Remaining groups/lists---
---Above---
-->{{#if:{{{above2|}}}|<!--
-->{{#if:{{{title|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
--><tr><td class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" <!--
-->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}">{{{above2}}}</td></tr>}}<!--


-->{{#if:{{{list2|}}}|<!--
-->{{#if:{{{list2|}}}|<!--
Line 85: Line 94:
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
{{{list2}}}</div></td></tr>}}<!--
{{{list2}}}</div></td></tr>}}<!--
-->{{#if:{{{above3|}}}|<!--
-->{{#if:{{{title|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
--><tr><td class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" <!--
-->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}">{{{above3}}}</td></tr>}}<!--


-->{{#if:{{{list3|}}}|<!--
-->{{#if:{{{list3|}}}|<!--
Line 94: Line 108:
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
{{{list3}}}</div></td></tr>}}<!--
{{{list3}}}</div></td></tr>}}<!--
-->{{#if:{{{above4|}}}|<!--
-->{{#if:{{{title|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
--><tr><td class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" <!--
-->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}">{{{above4}}}</td></tr>}}<!--


-->{{#if:{{{list4|}}}|<!--
-->{{#if:{{{list4|}}}|<!--
Line 103: Line 122:
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
{{{list4}}}</div></td></tr>}}<!--
{{{list4}}}</div></td></tr>}}<!--
-->{{#if:{{{above5|}}}|<!--
-->{{#if:{{{title|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
--><tr><td class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" <!--
-->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}">{{{above5}}}</td></tr>}}<!--


-->{{#if:{{{list5|}}}|<!--
-->{{#if:{{{list5|}}}|<!--
Line 112: Line 136:
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
  --><div style="padding:{{{listpadding|0em 0.25em}}}">
{{{list5}}}</div></td></tr>}}<!--
{{{list5}}}</div></td></tr>}}<!--
-->{{#if:{{{above6|}}}|<!--
-->{{#if:{{{title|}}}|<tr style="height:2px;"><td></td></tr>}}<!--
--><tr><td class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" <!--
-->colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}">{{{above6}}}</td></tr>}}<!--


-->{{#if:{{{list6|}}}|<!--
-->{{#if:{{{list6|}}}|<!--
Line 259: Line 288:


--><noinclude>
--><noinclude>
[[Category:Templates|Navbox]]
The Navbox is used for creating a navigation box like the template <code><nowiki>{{Level courses}}</nowiki></code>. The behind-the-scenes code for this is very complicated, and should not be edited without a discussion (also because it would impact a lot of pages).
 
== Usage ==
To use this template we start by using the following (we want to keep the styling the same across pages).
 
<code><nowiki>
{{Navbox</nowiki><br>
| name  = Level courses<br>
| state = <nowiki>{{{state|uncollapsed}}}</nowiki><br>
| liststyle  = padding: 0.25em;<br>
| titlestyle = background: #0a53e7; color: white;<br>
| abovestyle = background: #5485E7; color: white;<br>
| groupstyle = background: #85A8FF; color: white;<br>
| evenstyle  = background: #E2F1FC;<br>
| oddstyle  = background: #EFF8FE;<br>
</code>
The code above is mostly for styling purposes, so this should always be copied to each navigation box.
 
 
Below you can see the things that are allowed to be edited.
The first, <code>title</code> gives the title of the Navbox. The first part between square brackets <code>[[]]</code> is used for the link to the main page of the Navbox. The part between the <code><nowiki><font></font></nowiki></code> gives the title displayed by the system.<br>
<code>above''n''</code> displays the bar across for a subsection, for our purposes we want these things '''bold'''.<br>
<code>group''n''</code> is the name of the <code>list''n''</code>.<br>
Only <code>title</code> and <code>list''n''</code> are required.
 
<code>| title = <nowiki>[[List_of_Courses|<font color="white">Courses</font>]]</nowiki><br>
| above1 = <nowiki>'''Main Courses'''</nowiki><br>
| group1  = First Floor<br>
| list1  = <nowiki>[[Bob-omb Battlefield]] • [[Whomp's Fortress]] • [[Jolly Roger Bay]] • [[Cool, Cool Mountain]] • [[Big Boo's Haunt]]</nowiki><br>
}}</code><br>
(for now, the highest you can go with <code>above''n''</code> is <code>above6</code>.)
 
 
[[Category:Navbox templates]]
[[Category:Formatting templates]]
</noinclude>
</noinclude>

Latest revision as of 19:32, 10 April 2019

The Navbox is used for creating a navigation box like the template {{Level courses}}. The behind-the-scenes code for this is very complicated, and should not be edited without a discussion (also because it would impact a lot of pages).

Usage

To use this template we start by using the following (we want to keep the styling the same across pages).

{{Navbox
| name = Level courses
| state = {{{state|uncollapsed}}}
| liststyle = padding: 0.25em;
| titlestyle = background: #0a53e7; color: white;
| abovestyle = background: #5485E7; color: white;
| groupstyle = background: #85A8FF; color: white;
| evenstyle = background: #E2F1FC;
| oddstyle = background: #EFF8FE;
The code above is mostly for styling purposes, so this should always be copied to each navigation box.


Below you can see the things that are allowed to be edited. The first, title gives the title of the Navbox. The first part between square brackets [[]] is used for the link to the main page of the Navbox. The part between the <font></font> gives the title displayed by the system.
aboven displays the bar across for a subsection, for our purposes we want these things bold.
groupn is the name of the listn.
Only title and listn are required.

| title = [[List_of_Courses|<font color="white">Courses</font>]]
| above1 = '''Main Courses'''
| group1 = First Floor
| list1 = [[Bob-omb Battlefield]] • [[Whomp's Fortress]] • [[Jolly Roger Bay]] • [[Cool, Cool Mountain]] • [[Big Boo's Haunt]]
}}

(for now, the highest you can go with aboven is above6.)