Difference between revisions of "Template:Navbar"

From WPRDC Wiki
Jump to navigation Jump to search
>Shirayuki
(use translation aware transclusion)
>Baris6161TURK
(Adding translate tags and remove unneeded deprecated information.)
Line 25: Line 25:


--></small></span><noinclude>
--></small></span><noinclude>
{{documentation|content=
{{Documentation|content=
 
<translate>
== Usage ==
== Usage ==


===General===
=== General ===


When one of the following examples is placed inside a given [[Special:MyLanguage/Help:Templates|template]], it adds navbar navigational functionality:
When one of the following examples is placed inside a given [[<tvar|1>Special:MyLanguage/Help:Templates</>|template]], it adds navbar navigational functionality:
</translate>


: {{tlx|Navbar|Navbar|mini{{=}}1}}
: {{tlx|Navbar|Navbar|mini{{=}}1}}
Line 37: Line 38:
: {{tlx|Navbar|Navbar|fontstyle{{=}}color:green}}
: {{tlx|Navbar|Navbar|fontstyle{{=}}color:green}}


The <code><nowiki>{{subst:PAGENAME}}</nowiki></code> will be substituted with the template's name when parsed by the servers. For example, {{tlx|Navbar|navbar/doc}} gives:
<translate>
The <tvar|1><code>{{<nowiki/>subst:PAGENAME}}</code></> will be substituted with the template's name when parsed by the servers.</translate>
<translate>For example, <tvar|1>{{tlx|Navbar|navbar/doc}}</> gives:
</translate>


{{Navbar|navbar/doc}}
{{Navbar|navbar/doc}}


===Font-size===
<translate>
=== Font-size ===


Font-size is 88% when used in a navbar, and 100% when nested in a navbox.
Font-size is <tvar|1><code>88%</code></> when used in a navbar, and <tvar|2><code>100%</code></> when nested in a navbox.
In the navbar, the weight is "normal"; when nested in navbox, it takes on the outer setting. The middot is bold.
</translate>
<translate>
In the navbar, the weight is "<tvar|1><code>normal</code></>"; when nested in navbox, it takes on the outer setting.
</translate>
<translate>
The middot is bold.


== Examples ==
== Examples ==


===Required parameters===
=== Required parameters ===
 
</translate>
* {{tlx|Navbar|Template Name}} the template name is required.
* {{tlx|Navbar|''<translate>template name</translate>''}} — <translate>the template name is required.</translate>
 
===Optional parameters===


<translate>
=== Optional parameters ===
</translate>
{{(}}{{!}} class="wikitable"
{{(}}{{!}} class="wikitable"
! Options !! Parameters !! Produces...
! <translate>Options</translate> !! <translate>Parameters</translate> !! <translate>Produces...</translate>
{{!}}-
{{!}}-
{{!}} Basic {{!}}{{!}} {{tlx|Navbar|Template Name}} {{!}}{{!}} {{navbar|navbar/doc}}
{{!}} <translate>Basic</translate> {{!}}{{!}} {{tlx|Navbar|''<translate>template name</translate>''}} {{!}}{{!}} {{navbar|navbar/doc}}
{{!}}-
{{!}}-
{{!}} Different text {{!}}{{!}} {{tlx|Navbar|Template Name|text{{=}}This template:}} {{!}}{{!}} {{navbar|navbar/doc|text=This template:}}
{{!}} <translate>Different text</translate> {{!}}{{!}} {{tlx|Navbar|''<translate>template name</translate>''|text{{=}}<translate>This template:</translate>}} {{!}}{{!}} {{navbar|navbar/doc|text=<translate>This template:</translate>}}
{{!}}-
{{!}}-
{{!}} Without "This box:" text {{!}}{{!}} {{tlx|Navbar|Template Name|plain{{=}}1}} {{!}}{{!}} {{navbar|navbar/doc|plain=1}}
{{!}} <translate>Without "This box:" text</translate> {{!}}{{!}} {{tlx|Navbar|''<translate>template name</translate>''|plain{{=}}1}} {{!}}{{!}} {{navbar|navbar/doc|plain=1}}
{{!}}-
{{!}}-
{{!}} Short version {{!}}{{!}} {{tlx|Navbar|Template Name|mini{{=}}1}} {{!}}{{!}} {{navbar|navbar/doc|mini=1}}
{{!}} <translate>Short version</translate> {{!}}{{!}} {{tlx|Navbar|''<translate>template name</translate>''|mini{{=}}1}} {{!}}{{!}} {{navbar|navbar/doc|mini=1}}
{{!}}-
{{!}}-
{{!}} With a color option {{!}}{{!}} {{tlx|Navbar|Template Name|fontstyle{{=}}color:green}} {{!}}{{!}} {{navbar|navbar/doc|fontstyle=color:green}}
{{!}} <translate>With a color option</translate> {{!}}{{!}} {{tlx|Navbar|''<translate>template name</translate>''|fontstyle{{=}}color:green}} {{!}}{{!}} {{navbar|navbar/doc|fontstyle=color:green}}
{{!}}-
{{!}}-
{{!}} With brackets
{{!}} <translate>With brackets</translate>
{{!}} {{tlx|Navbar|Template Name|brackets{{=}}1}}
{{!}} {{tlx|Navbar|<translate>template name</translate>|brackets{{=}}1}}
{{!}} {{navbar|navbar/doc|brackets=1}}
{{!}} {{navbar|navbar/doc|brackets=1}}
{{!}}{{)}}
{{!}}{{)}}


===Deprecated parameters===
<translate>
 
The <code>miniv=1</code>, <code>viewplain=1</code>, <code>nodiv=1</code> and <code>fontcolor=</code> parameters have been deprecated. To implement the view-only version, use the {{tlx|v}} or {{tlx|view}} templates instead.
 
== Notes ==
== Notes ==


Navbar is contained within a {{tag|div}} in order to accommodate a horizontal unnumbered list. This means it cannot be placed inside a {{tag|span}} or other inline element, because Tidy will 'fix' situations where it finds block elements inside inline elements.
Navbar is contained within a <tvar|1>{{tag|div}}</> in order to accommodate a horizontal unnumbered list.
 
</translate>
== Prepackaged ==
<translate>
 
This means it cannot be placed inside a <tvar|1>{{tag|span}}</> or other inline element, because Tidy will 'fix' situations where it finds block elements inside inline elements.
;{{tl|Tnavbar-header}}: Positions <small>v{{·}}d{{·}}e</small> on the right edge of the line, often used in non-collapsible navbox heading.
</translate>
;{{tl|Tnavbar-navframe}}: For use in conjunction with [[Wikipedia:NavFrame|Navframe divs]], positions <small>v{{·}}d{{·}}e</small> opposite of the [hide]/[show] feature.
;{{tl|Tnavbar-collapsible}}: For use in conjunction with [[Wikipedia: NavFrame#Collapsible tables|Collapsible tables]], floats <small>v{{·}}d{{·}}e</small> opposite of the [hide]/[show] feature.


<!--- PLEASE ADD METADATA TO THE <includeonly> SECTION HERE --->
<!--- PLEASE ADD METADATA TO THE <includeonly> SECTION HERE --->
Line 90: Line 96:
[[Category:Formatting templates{{#translation:}}]]
[[Category:Formatting templates{{#translation:}}]]
</includeonly>
</includeonly>
}}
}}
</noinclude>
</noinclude>

Revision as of 19:00, 5 March 2021

<languages/> <translate> This box:</translate> [[Template:{{{1}}}|<span style="" title="<translate nowrap> View this template</translate>"><translate> view</translate>]] · [{{fullurl:Template talk:{{{1}}}}} <span style="" title="<translate nowrap> Discuss this template</translate>"><translate> talk</translate>] · [{{fullurl:Template:{{{1}}}|action=edit}} <span style="" title="<translate nowrap> Edit this template</translate>"><translate> edit</translate>] Lua error in Module:TNT at line 158: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Documentation.tab.[[Category:Template documentation pages{{#translation:}}]]