From Wikipedia, the free encyclopedia
This template allows a navigational template to be set up relatively quickly by supplying it one or more lists of links. It is similar to {{Navbox generic}} in appearance, with some default styles that should work for most navigational templates. It is not recommended that one modifies the default styles but it is possible if one wishes to do so.
Please remove the parameters that are left blank.
{{Navbox |name = {{subst:PAGENAME}} |state = |title = |image = |above = |group1 = |list1 = |group2 = |list2 = ... |group20 = |list20 = |below = }}
The navbox uses lowercase parameter names, as shown in the box (at right). The mandatory name and title will create a one-line box if other parameters are omitted.
Images and groups have restrictions explained below under Parameter descriptions, where another parameter ("imageleft" ) can replace all group-cells.
Notice "group1" (etc.) is optional, as are sections named "above/below".
The concise list of parameters is as follows:
name -
the name of the template.title -
text in the title bar, such as: [[Widget stuff]].state - autocollapse, show, collapsed
, or plain
(the status of box expansion,
titlestyle -
a CSS style for the title-bar, such as: background:gray;
groupstyle -
a CSS style for the group-cells, such as: background:lightgray;
image -
an optional right-side image (coded as the whole image tag: [[Image:XX.jpg|90px]] ).imageleft -
an optional left-side image, replacing group-cells (coded as the whole image tag).above -
text to appear above the group/list section (could be a list of overall wikilinks).groupn -
the left-side text before list-n (if group-n omitted, list-n starts at left of box).listn -
text listing wikilinks, often separated by middot templates, such as: [[A]]{{·}}
[[B]]below -
optional text to appear below the group/list section.navbar -
title-bar nav link (default: Tnavbar
for v • d • e links; "navbar=plain" will omit, but should only be used when absolutely necessary).Further details, and complex restrictions, are explained below under section Parameter descriptions. See some alternate navbox formats under: Layout of table.
{{subst:PAGENAME}}
for this value as a shortcut.{{-}}
to ensure proper centering.<div> </div>
. At least one list parameter is required; each additional list is displayed in a separate row of the table. Each listn may be preceded by a corresponding groupn parameter, if provided (see below).[[Image:Example.jpg|100px]]
[[Image:Example.jpg|100px]]
Styles are generally not recommended as to maintain consistency among templates and pages in Wikipedia. However, the option to modify styles is given.
titlestyle = background:#nnnnnn;
titlestyle = background:name;
background:#nnnnnn;
width:N [em/%/px or width:auto];
float:[left/right/none];
clear:[right/left/both/none];
background:#nnnnnn;
text-align:[left/center/right];
vertical-align:[top/middle/bottom];
background:#nnnnnn;
text-align:[left/center/right];
The style settings listed here are those that editors using the navbox change most often. The other more complex style settings were left out of this list to keep it simple.
titlestyle = background:#ccccff;
bodystyle = background:white; width:100%; vertical-align:middle;
abovestyle = background:#ddddff; text-align:center;
belowstyle = background:#ddddff; text-align:center;
groupstyle = background:#ddddff; text-align:right;
liststyle = background:transparent; text-align:left/center;
oddstyle = background:transparent;
evenstyle = background:#f7f7f7;
Since liststyle and oddstyle are transparent odd lists have the color of the bodystyle, which defaults to white. A list has text-align:left;
if it has a group, if not it has text-align:center;
. Since only bodystyle has a vertical-align all the others inherit its vertical-align:middle;
.
autocollapse, show, collapsed
or plain
autocollapse
. A navbox with autocollapse
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. For the technically minded, see MediaWiki:Common.js.collapsed
, the navbox will always start out in a collapsed state.plain
, the navbox will always be expanded with no [hide] link on the right.autocollapse
, collapsed
or plain
(such as "show"), the navbox will always start out in an expanded state, but have the "hide" button.state =
<noinclude>show</noinclude><includeonly>autocollapse</includeonly>Tnavbar
. If set to plain
, the v • d • e links on the left side of the titlebar will not be displayed. Currently, however, the title will also no longer be centered. See #Title centering below for a workaround.Table generated by {{Navbox}} without image, above and below parameters (borders added for illustration only):
Table generated by {{Navbox}} with image, above and below parameters (borders added for illustration only):
Table generated by {{Navbox}} with image, imageleft, lists, and without groups, above, below:
If the either the navbar (the v • d • e links) or the [show]/[hide] are disabled, then the title is not centered:
This can be resolved by padding the title with {{pad|5.5em}} on the right or left:
Note that omitting both the [show]/[hide] link and the navbar has no effect on the title centering, as follows:
{{Navbox |name = Navbox/doc |title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]{{-}}''without image'' |group1 = Centre |list1 = [[Cyberjaya]] |group2 = Area |list2 = [[Klang Valley]] |group3 = Major landmarks |list3 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} [[Kuala Lumpur International Airport]] |group4 = Infrastructure |list4 = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]] |group5 = Prime applications |list5 = [[EGovernment]]{{·}} [[MyKad]] }}
{{Navbox |name = Navbox/doc |title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]] |image = [[Image:Flag of Malaysia.svg|80px]] |list1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} [[Kuala Lumpur International Airport]] }}
{{Navbox |name = Navbox/doc |title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]] |image = [[Image:Flag of Malaysia.svg|80px]] |imageleft = [[Image:Flag of Malaysia.svg|80px]] |list1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]] |list2 = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]] |list3 = [[EGovernment]]{{·}} [[MyKad]] |list4 = [[Klang Valley]] }}
{{Navbox |name = Navbox/doc |title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]] |image = [[Image:Flag of Malaysia.svg|80px]] |above = Above text goes here |group1 = Centre |list1 = [[Cyberjaya]] |group2 = Area |list2 = [[Klang Valley]] |group3 = Major landmarks |list3 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} [[Kuala Lumpur International Airport]] |group4 = Infrastructure |list4 = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]] |group5 = Prime applications |list5 = [[EGovernment]]{{·}} [[MyKad]] |below = Website: [http://www.msc.com.my/ www.msc.com.my] }}
Internally this meta template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta templates since wiki markup has several drawbacks. For instance it makes it harder to use parser functions and special characters in parameters.
Parser functions are used for calculations.
For more technical details see the talk page, the CSS classes in MediaWiki:common.css and the collapsible table used to hide the box in MediaWiki:common.js
collapsible | Header color† | Image | Groups | Style (body) parameter/s | Example | |
---|---|---|---|---|---|---|
{{Navigation}} | NavFrame | NavHead | No | No | Yes | {{OPEC}} |
{{Navigation with image}} | NavFrame | NavHead | Left/right of body | No | Yes | {{HolmesNovels}} |
{{Navigation with columns}} | NavFrame | NavHead | No | No | Yes | |
{{Dynamic navigation box}} | collapsible | navbox | No | No | Yes | {{CSUHeads}} |
{{Dynamic navigation box with image}} | NavFrame | NavHead | Upper left | No | No | {{SlovakPMs}} |
{{Navbox generic}} | collapsible | navbox | Right-hand side | Yes | Yes | {{Dilbert}} |
{{NavigationBox}} | No | navbox | Right of title+body | No | No | {{EPA}} |
{{Commons:NavigationBox}} | No | #ccccff | Right of title+body | No | No | |
{{Commons:Dynamic navigation box}} | NavFrame | #ccccff | No | No | No | |
{{Commons:Dynamic navigation box with image}} | NavFrame | #ccccff | Upper left | No | No | |
† The background color for the header or title is inherited from the class listed below. The templates have titlestyle parameters that can be used to override the default. |
Type | CSS classes | Collapses when | Custom initial state | Nesting | Header color | Font size |
---|---|---|---|---|---|---|
NavFrame div | NavFrame, NavHead, NavContent | 3+ of the same | No | Yes | #ccccff | 95% |
Collapsible table | collapsible, navbox | 2+ of the same | Yes | Yes | #ccccff | 90% |
For the technically minded, see Common.css and Common.js. |
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.