Template:Navbox generic/doc

From Wikipedia, the free encyclopedia

This is the template documentation page for {{Navbox generic}}.
It is not intended to be viewed directly. If it uses variables, some links may appear broken. Do not replace these variables with hardcoded page names or URLs.

This template allows a navigational template to be set up quickly by supplying it one or more lists of links.

Contents

[edit] Blank

{{Navbox generic
|name    = {{subst:{{PAGENAME}}}}
|title   =
|style   =
|group1  =
|list1   =
|group2  =
|list2   =
|group3  =
|list3   =
 ...
|group10 =
|list10  =
}}

[edit] Parameters

[edit] Mandatory

name (or templateName)
The name of the template, which is needed for the "view · talk · edit" links to work properly on all of the pages where the template is used on. You can enter {{subst:PAGENAME}} for this value as a shortcut.
title
Text that appears centered in the titlebar (the top bar). Usually this is the template's topic, i.e. a succinct description of the body contents.

[edit] Optional

style
Specifies CSS values to apply to the template. For instance: text-align: (right|center|left|justified); width: (em, %, px, auto); float: (left|right|none); clear: (right|left|both|none); margin:...etc.. This option should be used sparingly as it can lead visual inconsistency.
color
Header color. Default is #ccf. Use of this parameter is discouraged. Care/consensus needed when using this parameter as multiple navigational templates on one page using different titlebar colors is likely to look unpleasant.
state
Defaults to autocollapse. If set to collapsed, the navbox will always start out in a collapsed state. If set to blank or anything other than autocollapse or collapsed, the navbox will always start out in a expanded state. A navbox with autocollapse will start out collapsed if there are 2 or more tables on the same page that is implemented with collapsible. For the technical minded, see MediaWiki:Common.js.
groupn
Specified the header for the following list
listn
The material contained by the cell, usually a list or list of links. Format is inline.

[edit] Example

[edit] Code

{{Navbox generic
|name   = {{subst:{{PAGENAME}}}}
|title  = [[Wikipedia:Navigational templates|Navigational Templates]]
|style  = width:50%; text-align:left;
|group1 = Physics
|list1  = [[Template:Cosmology|Cosmology]]{{·}} [[Template:General relativity|Relativity]]{{·}} [[Template:Quantum-theory|Quantum theory]]{{·}} [[Template:String-theory|String theory]]
|group2 = Continents
|list2  = [[Template:Continents of the world|World continents]]{{·}} [[Template:Africafooter|Africa]]{{·}} [[Template:Asiafooter|Asia]]{{·}} [[Template:Europefooter|Europe]]
|list3  = [[Template:National parks of Argentina|Argentinian National Parks]]
}}

[edit] Result

[edit] See also

v d e
Collapsible Image Groups Default Header Color Style Parameter Real Example
{{Navigation}} Using NavFrame No No #efefef No {{OPEC}}
{{Navigation with image}} Using NavFrame Left/right to the body No #efefef No {{Arab League}}
{{Dynamic navigation box}} Using collapsible No No #ccccff Yes {{CSUHeads}}
{{Dynamic navigation box with image}} Using NavFrame Upper left No #efefef No {{SPDHeads}}
{{Navbox generic}} Using collapsible No Yes #ccccff Yes {{Dilbert}}
{{NavigationBox}} No Right to both header and body No #ccccff No {{GermanPresidents}}
{{NavigationBox}} Broken
{{Dynamic navigation box}} Using NavFrame No No #ccccff No
{{Dynamic navigation box with image}} Using NavFrame Upper left No #efefef No
autocollapse logic custom initial state hide/show position
NavFrame 4 or more of the same No Right
collapsible 2 or more of the same Yes Left

{{NavigationBox}} (Image breaks titlebar; template deprecated? David Kernow (talk) 02:23, 29 November 2006 (UTC))