Template:Navbox/doc: Difference between revisions

FANDOM (talk | contribs)
mNo edit summary
 
No edit summary
 
Line 1: Line 1:
;Description
{{Documentation/Header}}
:This template is used to create a basic navigation box. You can do so by calling the template, via the steps under "Syntax", but it is recommended to '''copy the code verbatim''' via the steps under "Navbox Creation".
{{High Risk|pagetype=Main}}
;Navbox Creation
{{CSS}}
<inputbox>
This template should be used in navbox templates, which should be included at the bottom of each page that is linked in the template.
type=create
 
prefix=Template:
==Syntax==
preload=Template:Navbox
{| class="article-table" style="width:100%;"
editintro=Template:Navbox/doc
|-
buttonlabel=Make your navbox!
! Parameter(s)
default = Navbox Foo
! Usage
</inputbox>
! style="width:9%;" | Default value(s)
#Think of a name for your navbox, like "Navbox Foo". Type it in the above field, press the button, and save the page immediately. Be ready to return to ''this'' page to see the rest of the instructions.
|-
#Edit the resulting page in source mode.
| {{{name}}}
#Replace <code>{{{header}}}</code> with the text you would like to appear in the header.
| Should be identical to the template's name without namespace.
#Replace <code>{{{body}}}</code> with the text you would like to appear in the body.
| {{{name}}}
#To add another section, copy these four lines of code immediately below the lines in the existing code that they resemble:
|-
<pre>|-
| {{{title}}}
! style="padding:0.2em 0.5em;" nowrap="nowrap" class="color1" | {{{header}}}
| Sets the title used at the top of the navbox.
| {{{title}}}
|-
| {{{state}}}
| Allows you to change the collapsing state of the table. [[mw:Manual:Collapsible elements#Common.js script (Before 1.18)|More info]]. Collapsed is removed while on pages in the Template namespace, to make editing easier.
| collapsible
|-
| {{{titleclass}}}
| Set the css class used for the title area.
| ''None''
|-
| {{{titlestyle}}}
| Allows custom styling for the title area.
| ''None''
|-
| {{{bodyclass}}}
| Set the css class used for the body area.
| ''None''
|-
| {{{bodystyle}}}
| Allows custom styling for the body area.
| ''None''
|-
| {{{groupclass}}}
| Set the css class used for the group area.
| ''None''
|-
| {{{groupstyle}}}
| Allows custom styling for the group area.
| ''None''
|-
| {{{listclass}}}
| Set the css class used for the list area.
| ''None''
|-
| {{{liststyle}}}
| Allows custom styling for the list area.
| ''None''
|-
| {{{evenodd}}}
| Can be set to "swap" to reverse the order of styling among lists (starts with even by default).
| ''None''
|-
| {{{1}}}
| Can be set to "child" or "subgroup" to use styling intended for nested navboxes.
| ''None''
|-
| {{{group1-20}}}
| Adds the heading for the group number specified.
| {{{group1}}} = {{{group1}}}<br>{{{group2-20}}} = ''None''
|-
|-
| style="padding:0.2em 0.5em;" | {{{body}}}</pre>
| {{{list1-20}}}
| Adds text for the list number specified.
| {{{list1}}} = {{{list1}}}<br>{{{list2-20}}} = ''None''
|}


Save the page once you have added as many sections as you needed, and filled them with content. You may also want to create a /doc subpage explaining that to call the resulting template, one must only type <code>{<nowiki/>{Navbox Foo}}</code>, or rather, whatever we decided to name the template in step 1.
==Sample output==
<pre>
{{Navbox
| name = Navbox
| title = Navbox
| bodyclass = hlist


;Syntax
| group1 = Group 1
| list1 = List 1


<pre>{{navbox
| group2 = Group 2
|header=Land of Bob
| list2 = {{Navbox|child
|body=This <nowiki>[[place]]</nowiki> and that <nowiki>[[place]]</nowiki>.
| evenodd=swap
}}</pre>
| group1 = Group 2.1
| list1 = List 2.1
| group2 = Group 2.2
| list2 = List 2.2
| group3 = Group 2.3
| list3 = List 2.3
}}


:Results in...
| group3 = Group 3
| list3 =
* List 3
* List
* List
}}
</pre>
{{Navbox
| name = Navbox
| title = Navbox
| bodyclass = hlist


{{navbox
| group1 = Group 1
|header=Land of Bob
| list1 = List 1
|body=This <nowiki>[[place]]</nowiki> and that <nowiki>[[place]]</nowiki>.
 
| group2 = Group 2
| list2 = {{Navbox|child
| evenodd=swap
| group1 = Group 2.1
| list1 = List 2.1
| group2 = Group 2.2
| list2 = List 2.2
| group3 = Group 2.3
| list3 = List 2.3
}}
 
| group3 = Group 3
| list3 =
* List 3
* List
* List
}}
}}
<includeonly>[[Category:Navbox templates]]</includeonly><noinclude>[[Category:Template documentation]]</noinclude>