This page is protected against editing.

Template:Navbox

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Navbox/doc.
Cascade Protected This template has been fully protected because it’s transcluded on one or more cascade protected pages.
Please discuss changes on the talk page or request unprotection.

No description yet available.

Usage

{{Navbox
 |name   =
 |state  =
 |title  =
 |image  =
 |group1 =
 |list1  =
}}

Template parameters

ParameterDescriptionDefaultStatus
nameTemplate Namethe name of the templateemptyrequired
listclassList Classa CSS class for the list cells, usually hlist for horizontal lists. Alternatively, use bodyclass for the whole boxemptyoptional
statecontrols when a navbox is expanded or collapsedexpandedoptional
titletext in the title bar, such as: [[Widget stuff]]emptyoptional
abovetext to appear above the group/list section (could be a list of overall wikilinks)emptyoptional
imagean 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= ]]emptyoptional
group1the left-side text before list-n (if group-n omitted, list-n starts at left of box) (up to 20)emptyoptional
list1text listing wikilinks using a wikilist format[clarification needed] (up to 20)emptyoptional
belowoptional text to appear below the group/list sectionemptyoptional
titlestylea CSS style for the title-bar, such as: background: gray;emptyoptional
groupstylea CSS style for the group-cells, such as: background: #eee;emptyoptional
imageleftan optional left-side image (code the same as the "image" parameter)emptyoptional
<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.

Discussion
There is an ongoing discussion about that matter. Feel invited to comment if you are experienced in either way, your time permits and if you like to share your opinion or to make a suggestion.


Wikipedia's help about TemplateDataCommons-specific information

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
above

text to appear above the group/list section (could be a list of overall wikilinks)

Contentoptional
below

optional text to appear below the group/list section

Contentoptional
group1

the left-side text before list-n (if group-n omitted, list-n starts at left of box) (up to 20)

Contentoptional
groupstyle

a CSS style for the group-cells, such as: <code>background: #eee;</code>

Stringoptional
image

an optional right-side image, coded as the whole image. Typically it is purely decorative, so it should be coded as <code>[[File:<var>XX</var>.jpg|80px|link= |alt= ]]</code>

Contentoptional
imageleft

an optional left-side image (code the same as the "image" parameter)

Contentoptional
list1

text listing wikilinks using a wikilist format<sup>[''[[:en:Wikipedia:Please_clarify|clarification needed]]'']</sup> (up to 20)

Contentoptional
List Classlistclass

a CSS class for the list cells, usually <code>hlist</code> for horizontal lists. Alternatively, use bodyclass for the whole box

Stringoptional
Template Namename

the name of the template

Auto value
{{subst:PAGENAME}}
Templaterequired
state

controls when a navbox is <code>expanded</code> or <code>collapsed</code>

Default
expanded
Stringoptional
title

text in the title bar, such as: <code>[[Widget stuff]]</code>

Contentoptional
titlestyle

a CSS style for the title-bar, such as: <code>background: gray;</code>

Stringoptional

Additional information

The template is intended to be used in the following namespaces: the Template namespace

The template is intended to be used by the following user groups: all users

Example

{{Navbox|
| name = <!-- omitted to suppress the display of the links
              'V'+'T'+'E' at the left side of the title bar -->
| title = ''title''
| titlegroup = ''titlegroup''
| above = ''above''
| below = ''below''
| image = ''image''
| imageleft = ''imageleft''
| group1 = ''group1''
| list1 = ''list1''
| group2 = ''group2''
| list2 = ''list2''
| group23 = ''group23''
| list23 = ''list23''
| group104 = ''group104''
| list104 = ''list104''
| group1005 = ''group1005''
| list1005 = ''list1005''
| group10006 = ''group10006''
| list10006 = ''list10006''
}}

renders as:

See also

For more documentation, see w:Template:Navbox.

Localization

This template is not intended to be localized.