Template:Nav/doc: Difference between revisions

628 bytes removed ,  06:01, 7 September 2021
(merged nav templates)
 
 
(6 intermediate revisions by 3 users not shown)
Line 5: Line 5:
===Header===
===Header===
A header call to this template must be the first usage of this template.
A header call to this template must be the first usage of this template.
<pre>{{nav|header|DQI|Dragon Quest|class=navMainSeries}}</pre>
<pre>{{nav|header|DQI|{{DQ}}|title=Ninjas|class=navMainSeries}}</pre>
*header: A required parameter which marks this as the start of a navigation bar. This parameter must be the first parameter. It does not take a value.
*header: A required parameter which marks this as the start of a navigation bar. This parameter must be the first parameter. It does not take a value.
*linkname: A required parameter specifying the name of the template containing the nav template calls.  This parameter is a value only.  The parameter must be the second parameter.  It is used in the [[Template:tnav|tnav]] template in order to provide easy access to editing and discussion of the parent template.
*template: A required parameter specifying the name of the template containing the nav template calls.  This parameter is a value only.  The parameter must be the second parameter.  It is used in the [[Template:tnav|tnav]] template in order to provide easy access to editing and discussion of the parent template.
*title: A required parameter specifying the name to be displayed as the title of the navigation bar. This parameter must be the third parameter.
*titlelink: A required parameter specifying the name to be displayed as the title of the navigation bar. This parameter must be the third parameter.  If a title parameter is not specified, this parameter becomes both the title link destination and the actual title.
*title: An optional parameter for specifying a title other than the name of the titlelink parameter.  Useful when you want the title to link to a category page.
*class: An optional parameter for specifying a class name which will alter the colors/styles of the navigation bar.  By default, the navMainSeries class is used. This parameter must come after the 3 required parameters.
*class: An optional parameter for specifying a class name which will alter the colors/styles of the navigation bar.  By default, the navMainSeries class is used. This parameter must come after the 3 required parameters.
===Subheader===
===Section===
A subheader call is made to designate a subcategory row within the navigation bar.  Each subcategory row will then contain a variable number of links.
A section call is made to designate a subcategory row within the navigation bar.  Each subcategory row will then contain a variable number of links.
<pre>{{nav|subheader|Characters|class=navMainSeries|bg=alt}}</pre>
<pre>{{nav|section|Characters|class=navMainSeries|
*subheader: A required parameter marking the start of a subheader. This parameter must be the first parameter.
* [[link 1]]
* [[link 2]]
}}</pre>
*section: A required parameter marking this as a section. This parameter must be the first parameter.
*title: A required parameter specifying the name of the subheader category.  This parameter must be the second parameter.
*title: A required parameter specifying the name of the subheader category.  This parameter must be the second parameter.
*class: An optional parameter for specifying a class name which will alter the colors/styles of the subheader.  By default, the navMainSeries class is used.  This parameter must come after the 2 required parameters.
*class: An optional parameter for specifying a class name which will alter the colors/styles of the subheader.  By default, the navMainSeries class is used.  This parameter must come after the 2 required parameters.
*bg: An optional parameter specifying whether the alternate background color should be used for this subheader's links. This parameter must be given a dummy value such as 'alt'.  This parameter must come after the 2 required parameters.   
*content: A required parameter listing the links for a section.
===Items===
 
A nav item represents a single link to an article within the navigation bar.
<pre>{{nav|item|[[Dragon Quest IV]]}}</pre>
*item: A required parameter which marks this as an item.  This parameter must be the first parameter.
*link: A required parameter specifying the link to be included in the navigation bar.  This parameter must be the second parameter.
*nospacer: An optional parameter used to mark the first entry in a set of links.  This parameter must come after the 2 required parameters.  This parameter must be given a dummy value such as 'true'.
===Footer===
===Footer===
The footer call marks the end of the navigation bar.
The footer call marks the end of the navigation bar.
Line 32: Line 32:
The show/hide functionality is added automatically to all navigation bars via javascript.  No user input is necessary.  The [[Template:tnav|tnav template]] is used to provide easy access to editing/discussion links.
The show/hide functionality is added automatically to all navigation bars via javascript.  No user input is necessary.  The [[Template:tnav|tnav template]] is used to provide easy access to editing/discussion links.
==Example==
==Example==
===Sample===
===Sample===
{{nav|header|DQI|Dragon Quest}}
{{nav|header|DQI|Dragon Quest|title=''Dragon Quest''}}
{{nav|subheader|Characters}}
{{nav|section|Characters|
{{nav|item|[[Hero (Dragon Quest I)|Hero]]|nospacer=true}}
* [[Hero (Dragon Quest)|Hero]]
{{nav|item|[[Roto]]}}
* [[Erdrick]]
}}
{{nav|section|Locations|
* [[Alefgard]]
* [[Tantegel|Brecconary]]
* [[Erdrick's Cave]]
* [[Sanctum]]
* [[Quagmire Cave]]
* [[Tantegel]]
}}
{{nav|footer}}


{{nav|subheader|Locations|bg=alt}}
{{nav|item|[[Alefgard]]|nospacer=true}}
{{nav|item|[[Brecconary]]}}
{{nav|item|[[Roto's Cave]]}}
{{nav|item|[[Southern Shrine]]}}
{{nav|item|[[Swamp Cave]]}}
{{nav|item|[[Tantegel]]}}
{{nav|footer}}
===Code===
===Code===
<pre>
<pre>
{{nav|header|DQI|Dragon Quest}}
{{nav|header|DQI|Dragon Quest|title=''Dragon Quest''}}
{{nav|subheader|Characters}}
{{nav|section|Characters|
{{nav|item|[[Hero (Dragon Quest I)|Hero]]|nospacer=true}}
* [[Hero (Dragon Quest)|Hero]]
{{nav|item|[[Roto]]}}
* [[Erdrick]]
 
}}
{{nav|subheader|Locations|bg=alt}}
{{nav|section|Locations|
{{nav|item|[[Alefgard]]|nospacer=true}}
* [[Alefgard]]
{{nav|item|[[Brecconary]]}}
* [[Tantegel|Brecconary]]
{{nav|item|[[Roto's Cave]]}}
* [[Erdrick's Cave]]
{{nav|item|[[Southern Shrine]]}}
* [[Sanctum]]
{{nav|item|[[Swamp Cave]]}}
* [[Quagmire Cave]]
{{nav|item|[[Tantegel]]}}
* [[Tantegel]]
}}
{{nav|footer}}
{{nav|footer}}
</pre>
</pre>
224

edits