This page is protected against editing.

Template:Navbar

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Documentationview · edit · history · purge ]
This documentation is transcluded from Template:Navbar/doc.

No description yet available.

Usage

{{navbar |1= }}

Copyable examples when inside a given template adds navbar navigational functionality:

{{navbar|{{subst:PAGENAME}}|mini=1}}
{{navbar|{{subst:PAGENAME}}|plain=1}}
{{navbar|{{subst:PAGENAME}}|mini=1|nodiv=1}}
{{navbar|{{subst:PAGENAME}}|plain=1|nodiv=1}}
{{navbar|{{subst:PAGENAME}}|fontstyle=color:green}}
The {{subst:PAGENAME}} will be substituted with the template’s name when parsed by the servers.

The miniv=1, viewplain=1 and fontcolor= parameters have been deprecated. To use the view-only version, use the {{v}} or {{view}} templates instead.

Template parameters

ParameterDescriptionDefaultStatus
1nameName of the templateemptyrequired
plainplain versionHide the “This box:” textemptyoptional
minishort versionUse one-letter links instead of whole wordsemptyoptional
nodivinline versionUse <bdi> instead of <div> so that the template won’t have its own line in the textemptyoptional
stylebox styleCSS style for the whole boxemptyoptional
fontstylefont styleCSS style for the text, also applied to the links. Useful for setting font color as that would be overridden by default link color.emptyoptional
bracketsbracketsPut [brackets] around the linksemptyoptional
uselanglanguageSet the template’s language. Not used if the template is transcluded on pages translated with the Translate extension.emptyoptional
minivemptydeprecated
viewplainemptydeprecated
fontcolorfont colorSet the font color. Deprecated, use |fontstyle = color:<color> instead.emptydeprecated
Template data
<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

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
name1

Name of the template

Templaterequired
bracketsbrackets

Put [brackets] around the links

Unknownoptional
font colorfontcolor

Set the font color. Deprecated, use |fontstyle = color:&lt;color&gt; instead.

Linedeprecated
font stylefontstyle

CSS style for the text, also applied to the links. Useful for setting font color as that would be overridden by default link color.

Lineoptional
short versionmini

Use one-letter links instead of whole words

Unknownoptional
miniv

Unknowndeprecated
inline versionnodiv

Use &lt;bdi&gt; instead of &lt;div&gt; so that the template won’t have its own line in the text

Unknownoptional
plain versionplain

Hide the “This box:” text

Unknownoptional
box stylestyle

CSS style for the whole box

Lineoptional
languageuselang

Set the template’s language. Not used if the template is transcluded on pages translated with the Translate extension.

Lineoptional
viewplain

Unknowndeprecated

Additional information

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

The template is intended to be used by the following user groups: no user group specified

Example

{{navbar|navbar/doc}}

renders as:

See also

Localization

dansk  Deutsch  Deutsch (Sie-Form)‎  English  español  Esperanto  français  italiano  magyar  polski  português  svenska  Türkçe  македонски  русский  українська  বাংলা  中文  日本語  العربية 

This template makes use of {{Autotranslate}} and the translate extension.

Examples

Options Parameters Produces...
Normal {{navbar|Template Name}}
No "This box:" text. {{navbar|Template Name|plain=1}}
Short version. {{navbar|Template Name|mini=1}}
Good for "blending" into text. {{navbar|Template Name|nodiv=1}} Lorem This box: view  talk  edit Ipsum
Blended, no "This box:" text. {{navbar|Template Name|plain=1|nodiv=1}} Lorem view  talk  edit Ipsum
Blended, short version. {{navbar|Template Name|mini=1|nodiv=1}} Lorem v  d  e Ipsum
For a color option. {{navbar|Template Name|fontstyle=color:green}}