Difference between revisions of "Template:Navbox"
m |
m |
||
Line 4: | Line 4: | ||
{{!}} style="padding:0px;" {{!}} }} | {{!}} style="padding:0px;" {{!}} }} | ||
{{{!}} cellspacing="0" class="nowraplinks {{#if:{{{title|}}}|mw-collapsible mw-made-collapsible}} {{#if:{{{title|}}}|{{#switch:{{{state|}}}|plain|off=|#default=collapsible {{#if:{{{state|}}}|{{{state|}}}|autocollapse}}}}}} {{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=navbox-subgroup" style="width:100%;{{{bodystyle|}}};{{{style|}}}|#default=" style="width:100%;background:transparent;color:inherit}};{{{innerstyle|}}};" <!-- | {{{!}} cellspacing="0" class="nowraplinks {{#if:{{{title|}}}|mw-collapsible mw-made-collapsible}} {{#if:{{{title|}}}|{{#switch:{{{state|}}}|plain|off=|#default=collapsible {{#if:{{{state|}}}|{{{state|}}}|autocollapse}}}}}} {{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=navbox-subgroup" style="width:100%;{{{bodystyle|}}};{{{style|}}}|#default=" style="width:100%;background:transparent;color:inherit}};{{{innerstyle|}}};" <!-- | ||
− | |||
---Title and Navbar--- | ---Title and Navbar--- | ||
Line 12: | Line 11: | ||
! style="border-left:2px solid #fdfdfd;width:100%;|<nowiki/> | ! style="border-left:2px solid #fdfdfd;width:100%;|<nowiki/> | ||
! style="}}{{{basestyle|}}};{{{titlestyle|}}}" colspan={{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}{{#if:{{{titlegroup|}}}|-1}}}} class="navbox-title" {{!}} {{#if:{{#switch:{{{navbar|}}}|plain|off=1}} {{#if:{{{name|}}}||{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=1}}}}| {{#ifeq:{{{navbar|}}}|off|{{#ifeq:{{{state|}}}|plain|<div style="float:right;width:6em;"> </div>}}| {{#ifeq:{{{state|}}}|plain||<div style="float:left; width:6em;text-align:left;"> </div>}}}}| <div style="float:left; width:6em;text-align:left;"> {{navbar|{{{name}}}|fontstyle={{{basestyle|}}};{{{titlestyle|}}};border:none;|mini=1}} </div>{{#ifeq:{{{state|}}}|plain|<div style="float:right;width:6em;"> </div>}}}} <span style="font-size:{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=100|#default=110}}%;"> {{{title}}}</span> }}<!-- | ! style="}}{{{basestyle|}}};{{{titlestyle|}}}" colspan={{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}{{#if:{{{titlegroup|}}}|-1}}}} class="navbox-title" {{!}} {{#if:{{#switch:{{{navbar|}}}|plain|off=1}} {{#if:{{{name|}}}||{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=1}}}}| {{#ifeq:{{{navbar|}}}|off|{{#ifeq:{{{state|}}}|plain|<div style="float:right;width:6em;"> </div>}}| {{#ifeq:{{{state|}}}|plain||<div style="float:left; width:6em;text-align:left;"> </div>}}}}| <div style="float:left; width:6em;text-align:left;"> {{navbar|{{{name}}}|fontstyle={{{basestyle|}}};{{{titlestyle|}}};border:none;|mini=1}} </div>{{#ifeq:{{{state|}}}|plain|<div style="float:right;width:6em;"> </div>}}}} <span style="font-size:{{#switch:{{{border|{{{1|}}}}}}|subgroup|child|none=100|#default=110}}%;"> {{{title}}}</span> }}<!-- | ||
− | |||
---Above--- | ---Above--- | ||
Line 20: | Line 18: | ||
{{!}}- | {{!}}- | ||
{{!}} class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}" {{!}} {{{above}}} }}<!-- | {{!}} class="navbox-abovebelow" style="{{{basestyle|}}};{{{abovestyle|}}}" colspan="{{#expr:2{{#if:{{{imageleft|}}}|+1}}{{#if:{{{image|}}}|+1}}}}" {{!}} {{{above}}} }}<!-- | ||
− | |||
− | |||
---Body--- | ---Body--- | ||
Line 42: | Line 38: | ||
-->{{#if:{{{image|}}}|<nowiki/> | -->{{#if:{{{image|}}}|<nowiki/> | ||
{{!}} style="width:0%;padding:0px 0px 0px 2px;{{{imagestyle|}}}" rowspan={{#expr:1{{#if:{{{list2|}}}|+2}}{{#if:{{{list3|}}}|+2}}{{#if:{{{list4|}}}|+2}}{{#if:{{{list5|}}}|+2}}{{#if:{{{list6|}}}|+2}}{{#if:{{{list7|}}}|+2}}{{#if:{{{list8|}}}|+2}}{{#if:{{{list9|}}}|+2}}{{#if:{{{list10|}}}|+2}}{{#if:{{{list11|}}}|+2}}{{#if:{{{list12|}}}|+2}}{{#if:{{{list13|}}}|+2}}{{#if:{{{list14|}}}|+2}}{{#if:{{{list15|}}}|+2}}{{#if:{{{list16|}}}|+2}}{{#if:{{{list17|}}}|+2}}{{#if:{{{list18|}}}|+2}}{{#if:{{{list19|}}}|+2}}{{#if:{{{list20|}}}|+2}}}} {{!}} {{{image|}}} }} }}<!-- | {{!}} style="width:0%;padding:0px 0px 0px 2px;{{{imagestyle|}}}" rowspan={{#expr:1{{#if:{{{list2|}}}|+2}}{{#if:{{{list3|}}}|+2}}{{#if:{{{list4|}}}|+2}}{{#if:{{{list5|}}}|+2}}{{#if:{{{list6|}}}|+2}}{{#if:{{{list7|}}}|+2}}{{#if:{{{list8|}}}|+2}}{{#if:{{{list9|}}}|+2}}{{#if:{{{list10|}}}|+2}}{{#if:{{{list11|}}}|+2}}{{#if:{{{list12|}}}|+2}}{{#if:{{{list13|}}}|+2}}{{#if:{{{list14|}}}|+2}}{{#if:{{{list15|}}}|+2}}{{#if:{{{list16|}}}|+2}}{{#if:{{{list17|}}}|+2}}{{#if:{{{list18|}}}|+2}}{{#if:{{{list19|}}}|+2}}{{#if:{{{list20|}}}|+2}}}} {{!}} {{{image|}}} }} }}<!-- | ||
− | |||
---Remaining groups/lists--- | ---Remaining groups/lists--- |
Revision as of 07:55, 5 July 2020
|
- Parts of this page were taken from the The English Wikipedia's documentation on the Navbox template.
This navigational template creates a box with a long list of organized links, so that a user can move between similar pages quickly. The template has default CSS styling, which can be changed as needed, although this is not recommended. This template should be used in a variety of places throughout the wiki because of its ease of use and standardization.
Parameters
name
– The name of the Navboxtitle
– The title of the Navbox (shown at the top)titlestyle
– A CSS style for the title-bar, such as:background: aqua;
groupstyle
– A CSS style for the group-cells, such as:background: #f516db;
above
– Text to appear above the group/list sectionimage
– 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 extends to the left edge of the box, and defaults totext-align:center
styling).listn
– Text listing wikilinks using ahlist
format (where the wikilinks are styled as a horizontal list).below
– Optional text to appear below the group/list section.
Examples
{{Navbox | name = Navbox | title = Title | above = Above | image = [[File:StateMembership2019.jpeg | 200px]] | group1 = Group1 | list1 = List1 | group2 = Group2 | list2 = * List 1 * List 2 | group3 = Group3 | list3 = * List 1 * List 2 * List 3 | group4 = Group4 | list4 = * List 1 * List 2 * List 3 * List 4 | group5 = Group5 | list5 = * List 1 * List 2 * List 3 * List 4 * List 5 | below = Below }}
Adding Subgroups and using Imageleft
{{Navbox | name = Navbox | title = Title | above = Above | imageleft = [[File:StateMembership2019.jpeg | 200px]] | group1 = Group1 | list1 = List1 | group2 = Group2 | list2 = * List 1 * List 2 | group3 = Group3 | list3 = * List 1 * List 2 * List 3 | group4 = Group4 | list4 = * List 1 * List 2 * List 3 * List 4 | group5 = Group5 | list5 = {{Navbox|child | group1 = ChildGroup1 | list1 = ChildList1 | group2 = ChildGroup2 | list2 = ChildList2 }} | below = Below }}