Template:Navbox: Difference between revisions
From Tears of Themis Wiki
imported>Harmonea m (tweaking child to work with flex) |
imported>Harmonea (reimplement alternating row colors + fix copy paste errors) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
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|none=|#default=<div class="navbox {{{bodyclass|}}}" <!-- | --><includeonly>{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=|#default=<div class="navbox {{{bodyclass|}}}" <!-- | ||
-->style="{{{bodystyle|}}};{{{style|}}} | -->style="{{{bodystyle|}}};{{{style|}}}">}}<!-- | ||
--><div class="nowraplinks {{#if:{{{title|}}}|{{#switch:{{{state|}}}|plain|off=|<!-- | --><div class="nowraplinks {{#if:{{{title|}}}|{{#switch:{{{state|}}}|plain|off=|<!-- | ||
Line 27: | Line 27: | ||
-->{{#ifeq:{{{state|}}}|plain|<span style="float:right;width:6em;"> </span>}}}}<!-- | -->{{#ifeq:{{{state|}}}|plain|<span style="float:right;width:6em;"> </span>}}}}<!-- | ||
--><span class="{{{titleclass|}}}" style="font-size:{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none= | --><span class="{{{titleclass|}}}" style="font-size:{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=1|#default=1.1}}rem;"><!-- | ||
-->{{{title}}}</span></div>}}<!-- | -->{{{title}}}</span></div>}}<div class="mw-collapsible-content"><!-- | ||
---Above--- | ---Above--- | ||
-->{{#if:{{{above|}}}|<div class="row"<!-- | -->{{#if:{{{above|}}}|<div class="row"><!-- | ||
-- | --><div class="col-sm-12 col-md-12 navbox-abovebelow" style="<!-- | ||
-->{{{basestyle|}}}; {{{abovestyle|}}}"><!-- | -->{{{basestyle|}}}; {{{abovestyle|}}}"><!-- | ||
-->{{{above}}}</div></div>}}<!-- | -->{{{above}}}</div></div>}}<!-- | ||
Line 39: | Line 39: | ||
---First group/list and leftimage (due to flex, right image has been moved to the bottom)--- | ---First group/list and leftimage (due to flex, right image has been moved to the bottom)--- | ||
-->{{#if:{{{list1|}}}|<div class="row" | -->{{#if:{{{list1|}}}|<div class="row"><!-- | ||
-->{{#if:{{{imageleft|}}}|<!-- | -->{{#if:{{{imageleft|}}}|<!-- | ||
Line 46: | Line 45: | ||
-->{{{imageleft}}}</div>}}<!-- | -->{{{imageleft}}}</div>}}<!-- | ||
--><div class="col-sm-12 col-md-{{#expr:12{{#if:{{{imageleft|}}}|-2}}{{#if:{{{image|}}}|-2}}}}"><div class="row"><!-- | --><div class="col-sm-12 col-md-{{#expr:12{{#if:{{{imageleft|}}}|-2}}{{#if:{{{image|}}}|-2}}}}"><div class="row" style="margin-top:0px"><!-- | ||
-->{{#if:{{{group1|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group1style|}}}"><!-- | -->{{#if:{{{group1|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group1style|}}}"><!-- | ||
-->{{{group1}}}</div><div class="col-sm-12 col-md-10 | -->{{{group1}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list1style|}}}"><!-- | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list1style|}}}"><!-- | |||
-->{{{list1}}}</div></div><!-- | -->{{{list1}}}</div></div><!-- | ||
---Remaining groups/lists--- | ---Remaining groups/lists--- | ||
-->{{#if:{{{list2|}}}|<div class="row" | -->{{#if:{{{list2|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group2|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group2style|}}}"><!-- | -->{{#if:{{{group2|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group2style|}}}"><!-- | ||
-->{{{group2}}}</div><div class="col-sm-12 col-md-10 | -->{{{group2}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list2style|}}}"><!-- | |||
-->{{{list2}}}</div></div>}}<!-- | -->{{{list2}}}</div></div>}}<!-- | ||
-->{{#if:{{{list3|}}}|<div class="row | -->{{#if:{{{list3|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group3|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group3style|}}}"><!-- | |||
-->{{#if:{{{group3|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{{group3}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{{group3}}}</div><div class="col-sm-12 col-md-10 | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list3style|}}}"><!-- | ||
-->{{{list3}}}</div></div>}}<!-- | -->{{{list3}}}</div></div>}}<!-- | ||
-->{{#if:{{{list4|}}}|<div class="row | -->{{#if:{{{list4|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group4|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group4|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group4style|}}}"><!-- | ||
-->{{{group4}}}</div><div class="col-sm-12 col-md-10 | -->{{{group4}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list4style|}}}"><!-- | |||
-->{{{list4}}}</div></div>}}<!-- | -->{{{list4}}}</div></div>}}<!-- | ||
-->{{#if:{{{list5|}}}|<div class="row | -->{{#if:{{{list5|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group5|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group5|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group5style|}}}"><!-- | ||
-->{{{group5}}}</div><div class="col-sm-12 col-md-10 | -->{{{group5}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list5style|}}}"><!-- | |||
-->{{{list5}}}</div></div>}}<!-- | -->{{{list5}}}</div></div>}}<!-- | ||
-->{{#if:{{{list6|}}}|<div class="row | -->{{#if:{{{list6|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group6|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group2style|}}}"><!-- | -->{{#if:{{{group6|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group2style|}}}"><!-- | ||
-->{{{group6}}}</div><div class="col-sm-12 col-md-10 | -->{{{group6}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list6style|}}}"><!-- | |||
-->{{{list6}}}</div></div>}}<!-- | -->{{{list6}}}</div></div>}}<!-- | ||
-->{{#if:{{{list7|}}}|<div class="row | -->{{#if:{{{list7|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group7|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group7|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group7style|}}}"><!-- | ||
-->{{{group7}}}</div><div class="col-sm-12 col-md-10 | -->{{{group7}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list7style|}}}"><!-- | |||
-->{{{list7}}}</div></div>}}<!-- | -->{{{list7}}}</div></div>}}<!-- | ||
-->{{#if:{{{list8|}}}|<div class="row | -->{{#if:{{{list8|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group8|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group8|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group8style|}}}"><!-- | ||
-->{{{group8}}}</div><div class="col-sm-12 col-md-10 | -->{{{group8}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list8style|}}}"><!-- | |||
-->{{{list8}}}</div></div>}}<!-- | -->{{{list8}}}</div></div>}}<!-- | ||
-->{{#if:{{{list9|}}}|<div class="row | -->{{#if:{{{list9|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group9|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group9|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group9style|}}}"><!-- | ||
-->{{{group9}}}</div><div class="col-sm-12 col-md-10 | -->{{{group9}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list9style|}}}"><!-- | |||
-->{{{list9}}}</div></div>}}<!-- | -->{{{list9}}}</div></div>}}<!-- | ||
-->{{#if:{{{list10|}}}|<div class="row | -->{{#if:{{{list10|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group10|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group10|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group10style|}}}"><!-- | ||
-->{{{group10}}}</div><div class="col-sm-12 col-md-10 | -->{{{group10}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list10style|}}}"><!-- | |||
-->{{{list10}}}</div></div>}}<!-- | -->{{{list10}}}</div></div>}}<!-- | ||
-->{{#if:{{{list11|}}}|<div class="row | -->{{#if:{{{list11|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group11|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group11|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group11style|}}}"><!-- | ||
-->{{{group11}}}</div><div class="col-sm-12 col-md-10 | -->{{{group11}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list11style|}}}"><!-- | |||
-->{{{list11}}}</div></div>}}<!-- | -->{{{list11}}}</div></div>}}<!-- | ||
-->{{#if:{{{list12|}}}|<div class="row | -->{{#if:{{{list12|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group12|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group12|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group12style|}}}"><!-- | ||
-->{{{group12}}}</div><div class="col-sm-12 col-md-10 | -->{{{group12}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};;{{{list12style|}}}"><!-- | |||
-->{{{list12}}}</div></div>}}<!-- | -->{{{list12}}}</div></div>}}<!-- | ||
-->{{#if:{{{list13|}}}|<div class="row | -->{{#if:{{{list13|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group13|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group13|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group13style|}}}"><!-- | ||
-->{{{group13}}}</div><div class="col-sm-12 col-md-10 | -->{{{group13}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list13style|}}}"><!-- | |||
-->{{{list13}}}</div></div>}}<!-- | -->{{{list13}}}</div></div>}}<!-- | ||
-->{{#if:{{{list14|}}}|<div class="row | -->{{#if:{{{list14|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group14|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group14|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group14style|}}}"><!-- | ||
-->{{{group14}}}</div><div class="col-sm-12 col-md-10 | -->{{{group14}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list14style|}}}"><!-- | |||
-->{{{list14}}}</div></div>}}<!-- | -->{{{list14}}}</div></div>}}<!-- | ||
-->{{#if:{{{list15|}}}|<div class="row | -->{{#if:{{{list15|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group15|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group15|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group15style|}}}"><!-- | ||
-->{{{group15}}}</div><div class="col-sm-12 col-md-10 | -->{{{group15}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list15style|}}}"><!-- | |||
-->{{{list15}}}</div></div>}}<!-- | -->{{{list15}}}</div></div>}}<!-- | ||
-->{{#if:{{{list16|}}}|<div class="row | -->{{#if:{{{list16|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group16|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group16|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group16style|}}}"><!-- | ||
-->{{{group16}}}</div><div class="col-sm-12 col-md-10 | -->{{{group16}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list16style|}}}"><!-- | |||
-->{{{list16}}}</div></div>}}<!-- | -->{{{list16}}}</div></div>}}<!-- | ||
-->{{#if:{{{list17|}}}|<div class="row | -->{{#if:{{{list17|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group17|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group17|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group17style|}}}"><!-- | ||
-->{{{group17}}}</div><div class="col-sm-12 col-md-10 | -->{{{group17}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list17style|}}}"><!-- | |||
-->{{{list17}}}</div></div>}}<!-- | -->{{{list17}}}</div></div>}}<!-- | ||
-->{{#if:{{{list18|}}}|<div class="row | -->{{#if:{{{list18|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group18|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group18|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group18style|}}}"><!-- | ||
-->{{{group18}}}</div><div class="col-sm-12 col-md-10 | -->{{{group18}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list18style|}}}"><!-- | |||
-->{{{list18}}}</div></div>}}<!-- | -->{{{list18}}}</div></div>}}<!-- | ||
-->{{#if:{{{list19|}}}|<div class="row | -->{{#if:{{{list19|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group19|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group19|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group19style|}}}"><!-- | ||
-->{{{group19}}}</div><div class="col-sm-12 col-md-10 | -->{{{group19}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|even|{{{evenodd|odd}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list19style|}}}"><!-- | |||
-->{{{list19}}}</div></div>}}<!-- | -->{{{list19}}}</div></div>}}<!-- | ||
-->{{#if:{{{list20|}}}|<div class="row | -->{{#if:{{{list20|}}}|<div class="row"><!-- | ||
-->{{#if:{{{group20|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{ | -->{{#if:{{{group20|}}}|<div class="col-sm-12 col-md-2 navbox-group" style="{{{basestyle|}}};{{#if:{{{groupwidth|}}}|width:{{{groupwidth}}};}}{{{groupstyle|}}};{{{group20style|}}}"><!-- | ||
-->{{{group20}}}</div><div class="col-sm-12 col-md-10 | -->{{{group20}}}</div><div class="col-sm-12 col-md-10|<div class="col-sm-12 col-md-12}} <!-- | ||
-->{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{ | -->navbox-list navbox-{{#ifeq:{{{evenodd|}}}|swap|odd|{{{evenodd|even}}}}}" <!-- | ||
-->style="{{#if:{{{groupwidth|}}}||}};{{{liststyle|}}};{{{oddstyle|}}};padding:{{{list1padding|{{{listpadding|0em 0.25em}}}}}};{{{list20style|}}}"><!-- | |||
-->{{{list20}}}</div></div>}}<!-- | -->{{{list20}}}</div></div>}}<!-- | ||
Line 178: | Line 195: | ||
---Below--- | ---Below--- | ||
-->{{#if:{{{below|}}}|<div class="row" | -->{{#if:{{{below|}}}|<div class="row"><!-- | ||
--><div class="col-sm-12 col-md-12 navbox-abovebelow" style="{{{basestyle|}}};{{{belowstyle|}}}"><!-- | --><div class="col-sm-12 col-md-12 navbox-abovebelow" style="{{{basestyle|}}};{{{belowstyle|}}}"><!-- | ||
-->{{{below}}}</div></div>}}<!-- | -->{{{below}}}</div></div>}}<!-- | ||
--></div>{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=|#default=</div></ | --></div></div>{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=|#default=</div>}}</includeonly> | ||
<noinclude>{{doc}}[[Category:Navigation templates]]</noinclude> | <noinclude>{{doc}}[[Category:Navigation templates]]</noinclude> |
Latest revision as of 01:54, 8 February 2022
Usage[edit source]
Please remove the parameters that are left blank.
{{Navbox | name = {{subst:PAGENAME}}{{subst:void|Don't change anything on this line. It will change itself when you save.}} | title = | listclass = hlist | state = {{{state|}}} | above = | image = | group1 = | list1 = | group2 = | list2 = <!-- ... --> | group20 = | list20 = | below = }}
Parameter list[edit source]
The navbox uses lowercase parameter names, as shown in the box (above). The required name and title will create a one-line box if other parameters are omitted.
Notice "group1" (etc.) is optional, as are sections named "above/below".
The basic and most common parameters are as follows (see below for the full list):
name
– the name of the template.title
– text in the title bar, such as: [[Widget stuff]].listclass
– a CSS class for the list cells, usuallyhlist
for horizontal lists. Alternatively, use bodyclass for the whole box.state
– controls when a navbox is expanded or collapsed.titlestyle
– a CSS style for the title-bar, such as:background: gray;
groupstyle
– a CSS style for the group-cells, such as:background: #eee;
above
– text to appear above the group/list section (could be a list of overall wikilinks).image
– an optional right-side image, coded as the whole image. Typically it is purely decorative, so it should be coded as[[File:XX.jpg|80px|link=|alt=]]
.imageleft
– an optional left-side image (code the same as the "image" parameter).groupn
– the left-side text before list-n (if group-n omitted, list-n starts at left of box).listn
– text listing wikilinks using a wikilist format.below
– optional text to appear below the group/list section.
Parameter descriptions[edit source]
The following is a complete list of parameters for using {{Navbox}}
. In most cases, the only required parameters are name
, title
, and list1
.
Setup parameters[edit source]
- name
- The name of the template, which is needed for the "V • T • E" ("View • Talk • Edit") links to work properly on all pages where the template is used. You can enter
{{subst:PAGENAME}}
for this value as a shortcut. The name parameter is only mandatory if atitle
is specified, and theborder
parameter is not set, and thenavbar
parameter is not used to disable the navbar. - state [
mw-collapsed, mw-expanded, autocollapse, plain, off
]
- Defaults to
mw-collapsed
. If set tomw-collapsed
, the navbox will always start out in a collapsed state. - If set to
mw-expanded
, the navbox will always start out in an expanded state. - If set to
autocollapse
, the navbox will start out collapsed if there are two or more tables on the same page that use other collapsible tables. Otherwise, the navbox will be expanded. - If set to
plain
, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered (by using padding to offset the V • T • E links). - If set to
off
, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden.
- To show the box when standalone (non-included) but then auto-hide contents when in an article, put "expanded" inside
<noinclude|>
...</noinclude|>
tags. This setting will force the box visible when standalone (even when followed by other boxes), displaying "[hide]", but then it will auto-collapse the box when stacked inside an article:| state =
<noinclude|>
expanded</noinclude|>
- Often times, editors will want a default initial state for a navbox, which may be overridden in an article. Here is the trick to do this:
- In your intermediate template, create a parameter also named "state" as a pass-through like this:
| state = {{{state<includeonly>|your_desired_initial_state</includeonly>}}}
- The
<includeonly>
|
will make the template expanded when viewing the template page by itself.
- navbar
- If set to
plain
, the V • T • E links on the left side of the titlebar will not be displayed, and padding will be automatically used to keep the title centered. Useoff
to remove the V • T • E links, but not apply padding (this is for advanced use only; the "plain" option should suffice for most applications where a navbar is not desired). It is highly recommended that one not hide the navbar, in order to make it easier for users to edit the template, and to keep a standard style across pages. - border
The above documentation is transcluded from Template:Navbox/doc. (edit | history)