Difference between revisions of "Template:Navbar/doc"
m (1 revision) |
(No difference)
|
Latest revision as of 12:29, 14 June 2012
{{#ifeq: doc | doc
|
{{
#ifeq: show | show
| {{
{{#switch:
{{#if:
|
| {{#if:
|
{{#ifeq:|
| talk
|
}}
|
{{#ifeq:template|template talk
| talk
| template
}}
}}
}}
| main | = ambox | talk = tmbox | user = ombox | wikipedia = ombox | file | image = imbox | mediawiki = ombox | template = ombox | help = ombox | category = cmbox | portal = ombox | book = ombox | other | #default = ombox
}}
| type = notice
| image = 40px
| imageright =
| class =
| style =
| textstyle =
| text = This is a documentation subpage for Template:Navbar.
It contains usage information, categories, interlanguage links and other content that is not part of the original {{ #if: | {{{text2}}} | {{ #if: | {{{text1}}} | {{ #ifeq: Template | User | template template page | {{ #if: Template |template page|article}}}}}}}}.
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
}}
}}{{
#if:
|
| {{#ifexist:Template:Navbar|[[Category:{{
#switch: Template
| Template = Template
| User = User
| #default = Wikipedia
}} documentation pages]]|}}
}}
| }} {{#ifeq:|yes
|
{{#ifeq:{{#if:| {{{smallimage}}} | }}|none | | }}{{#if:{{#if: | {{{smallimageright}}} | }} | {{#ifeq:{{#if: | {{{smallimageright}}} | }}|none
||
}}
}}
{{#if:{{#if:| {{{smallimage}}} | }}
| {{#if:| {{{smallimage}}} | }}
| [[Image:{{#switch:content
| speedy = Imbox speedy deletion.png
| delete = Imbox deletion.png
| content = Imbox content.png
| style = Edit-clear.svg
| move = Imbox move.png
| protection = Imbox protection.png
| notice
| #default = Imbox notice.png
}} | {{#ifeq:yes|yes
| 30x30px
| 40x40px
}}|link=|alt=]]
}} | {{#if:| {{{smalltext}}} | This template is used on {{#if:7,200,000+|7,200,000+|a very large number of}} pages. To avoid large-scale disruption and unnecessary server load, any changes to this template should first be tested in the template's [[{{#ifeq:doc|doc| Template:Navbar | Template:Navbar/doc }}/sandbox|/sandbox]] or [[{{#ifeq:doc|doc| Template:Navbar | Template:Navbar/doc }}/testcases|/testcases]] subpages, or in your own user space. The tested changes can then be added in one single edit to the template. Please consider discussing any changes on {{#if:|[[{{{2}}}]]|the [[{{#ifeq:doc|doc| Template talk:Navbar | Template talk:Navbar/doc }}|talk page]]}} before implementing them. }} |
{{#if: | {{{smallimageright}}} | }} |
{{#switch:content
| | speedy | delete | content | style | move | protection | notice =
| #default =
}}
|
{{#ifeq:|none | | }}{{#if: | {{#ifeq:|none
||
}}
}}
{{#if:
|
| [[Image:{{#switch:content
| speedy = Imbox speedy deletion.png
| delete = Imbox deletion.png
| content = Imbox content.png
| style = Edit-clear.svg
| move = Imbox move.png
| protection = Imbox protection.png
| notice
| #default = Imbox notice.png
}} | {{#ifeq:|yes
| 30x30px
| 40x40px
}}|link=|alt=]]
}} | This template is used on {{#if:7,200,000+|7,200,000+|a very large number of}} pages. To avoid large-scale disruption and unnecessary server load, any changes to this template should first be tested in the template's [[{{#ifeq:doc|doc| Template:Navbar | Template:Navbar/doc }}/sandbox|/sandbox]] or [[{{#ifeq:doc|doc| Template:Navbar | Template:Navbar/doc }}/testcases|/testcases]] subpages, or in your own user space. The tested changes can then be added in one single edit to the template. Please consider discussing any changes on {{#if:|[[{{{2}}}]]|the [[{{#ifeq:doc|doc| Template talk:Navbar | Template talk:Navbar/doc }}|talk page]]}} before implementing them. |
{{#switch:content
| | speedy | delete | content | style | move | protection | notice =
| #default =
}} }}
Usage
General
When one of the following examples is placed inside a given template, it adds navbar navigational functionality:
- {{navbar|{{subst:PAGENAME}}|mini=1}}
- {{navbar|{{subst:PAGENAME}}|plain=1}}
- {{navbar|{{subst:PAGENAME}}|fontstyle=color:green}}
The {{subst:PAGENAME}} will be substituted with the template's name when parsed by the servers. For example, {{navbar|navbar/doc}} gives:
Font-size
Font-size is 88% when used in a navbar, and 100% 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.
Examples
Required parameters
{{navbar|Template Name}}– the template name is required.
Optional parameters
| Options | Parameters | Produces... | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Basic | {{navbar|Template Name}} |
[}}
|
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|{{#if:|v|view}}]] |
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}} | |
| Different text | {{navbar|Template Name|text=This template:}} |
[}}
|
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|{{#if:|v|view}}]] |
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}} | |
| Without "This box:" text | {{navbar|Template Name|plain=1}} |
[}}
|
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|{{#if:|v|view}}]] |
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}} | |
| Short version | {{navbar|Template Name|mini=1}} |
[}}
|
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|{{#if:1|v|view}}]] |
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|action=edit}} {{#if:1|e|edit}}]}}{{#if:|]}} | |
| With brackets | {{navbar|Template Name|brackets=1}}
|
[}}
|
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|{{#if:|v|view}}]] |
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:1|]}} | |
| With a color option (span) | {{navbar|Template Name|fontstyle=color:green}} |
[}}
|
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|{{#if:|v|view}}]] |
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}} | |
| To float to the side (div) | {{navbar|Template Name|style=float:right}} |
[}}
|
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|{{#if:|v|view}}]] |
#default = Navbar/doc | =
{{#ifeq: |
|
Template:navbar/doc | Navbar/doc
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}} |
Deprecated parameters
The miniv=1, viewplain=1, nodiv=1 and fontcolor= parameters have been deprecated. To implement the view-only version, use the {{{{#if:|subst:}}v{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} or {{{{#if:|subst:}}view{{#if:| |{{{2}}} }}{{#if:| |{{{3}}} }}{{#if:| |{{{4}}} }}{{#if:| |{{{5}}} }}{{#if:| |{{{6}}} }}{{#if:| |{{{7}}} }}{{#if:| |{{{8}}} }}{{#if:| |{{{9}}} }}{{#if:| |{{{10}}} }}{{#if:| |{{{11}}} }}{{#if:| |... }}}} templates instead.
Notes
Navbar is contained within a {{#switch:pair
|c|close =
|s|single
|o|open
|p|pair = <div{{#if:| {{{params}}}}}
}}{{#switch:pair
|c|close =
|s|single = />
|o|open = >
|p|pair = >...
}}{{#switch:pair
|s|single
|o|open =
|c|close
|p|pair = </div>
}} in order to accommodate a horizontal unnumbered list. This means it cannot be placed inside a {{#switch:pair
|c|close =
|s|single
|o|open
|p|pair = <span{{#if:| {{{params}}}}}
}}{{#switch:pair
|c|close =
|s|single = />
|o|open = >
|p|pair = >...
}}{{#switch:pair
|s|single
|o|open =
|c|close
|p|pair = </span>
}} or other inline element, because Tidy will 'fix' situations where it finds block elements inside inline elements.
Prepackaged
- {{Tnavbar-header}}
- Positions
|#default = Navbar/doc
| =
{{#ifeq: |
| Template:navbar/doc
| Navbar/doc
}}
}}|{{#if:1|v|view}}]]
{{#if:||
}}{{#if:|]}} on the right edge of the line, often used in non-collapsible navbox heading.
- {{Tnavbar-navframe}}
- For use in conjunction with Navframe divs, positions
|#default = Navbar/doc
| =
{{#ifeq: |
| Template:navbar/doc
| Navbar/doc
}}
}}|{{#if:1|v|view}}]]
{{#if:||
}}{{#if:|]}} opposite of the [hide]/[show] feature.
- {{Tnavbar-collapsible}}
- For use in conjunction with Collapsible tables, floats
|#default = Navbar/doc
| =
{{#ifeq: |
| Template:navbar/doc
| Navbar/doc
}}
}}|{{#if:1|v|view}}]]
{{#if:||
}}{{#if:|]}} opposite of the [hide]/[show] feature.
See also
- {{Ed}} – navbar style edit link
- {{Ed right}} – navbar style edit link aligned to right of page
- {{Edit}} – plain edit link
- {{Edit section}} – edit link aligned to right of page
With additional links:
- {{Navbar}}
[}}
|
#default = Navigation templates | =
{{#ifeq: |
|
Template:Navigation templates | Navigation templates
}}}}|{{#if:|v|view}}]] |
#default = Navigation templates | =
{{#ifeq: |
|
Template:Navigation templates | Navigation templates
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}} |
Collapsible | Header color | Image | Groups | Style (body) parameter/s |
Examples | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{Navbox}} | collapsible | navbox | Left/right of body | Yes | Yes | ||||||||||
| {{Navbox with collapsible groups}} | collapsible | navbox | Left/right of body and/or in each list | Yes | Yes |
| |||||||||
| {{Navbox with columns}} | collapsible | navbox | Left/right of columns | No | Yes | ||||||||||
| {{Navbox years}} | collapsible | navbox | No | No | No |
| Type | CSS classes | Javascript | Collapses when | Custom initial state |
Nesting |
|---|---|---|---|---|---|
| Collapsible tables | collapsible | Defined in Common.js | 2 or more autocollapse on page | Yes | Yes |