Template:Nav/doc: Difference between revisions

From Dragon Quest Wiki
m (→‎Section: class example)
 
(One intermediate revision by one other user 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|title=Ninjas|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.
*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.
*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.
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|section|Characters|
{{nav|section|Characters|
* [[Hero (Dragon Quest I)|Hero]]
* [[Hero (Dragon Quest)|Hero]]
* [[Roto]]
* [[Erdrick]]
}}
}}
{{nav|section|Locations|
{{nav|section|Locations|
* [[Alefgard]]
* [[Alefgard]]
* [[Brecconary]]
* [[Tantegel|Brecconary]]
* [[Roto's Cave]]
* [[Erdrick's Cave]]
* [[Southern Shrine]]
* [[Sanctum]]
* [[Swamp Cave]]
* [[Quagmire Cave]]
* [[Tantegel]]
* [[Tantegel]]
}}
}}
{{nav|footer}}
{{nav|footer}}
===Code===
===Code===
<pre>
<pre>
{{nav|header|DQI|Dragon Quest}}
{{nav|header|DQI|Dragon Quest|title=''Dragon Quest''}}
{{nav|section|Characters|
{{nav|section|Characters|
* [[Hero (Dragon Quest I)|Hero]]
* [[Hero (Dragon Quest)|Hero]]
* [[Roto]]
* [[Erdrick]]
}}
}}
{{nav|section|Locations|
{{nav|section|Locations|
* [[Alefgard]]
* [[Alefgard]]
* [[Brecconary]]
* [[Tantegel|Brecconary]]
* [[Roto's Cave]]
* [[Erdrick's Cave]]
* [[Southern Shrine]]
* [[Sanctum]]
* [[Swamp Cave]]
* [[Quagmire Cave]]
* [[Tantegel]]
* [[Tantegel]]
}}
}}
{{nav|footer}}
{{nav|footer}}
</pre>
</pre>

Latest revision as of 01:01, 7 September 2021

The Nav template is used to build navigation bars for various topics/subjects on the Dragon Quest wiki.

Usage[edit]

The Nav template is a complex template requiring more than one template invocation to use correctly. These template calls will most likely be inside another template which is named for the subject matter content of the navigational bar.

Header[edit]

A header call to this template must be the first usage of this template.

{{nav|header|DQI|{{DQ}}|title=Ninjas|class=navMainSeries}}
  • 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.
  • 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 tnav template in order to provide easy access to editing and discussion of the parent template.
  • 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.

Section[edit]

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.

{{nav|section|Characters|class=navMainSeries|
* [[link 1]]
* [[link 2]]
⋮
}}
  • 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.
  • 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.
  • content: A required parameter listing the links for a section.

Footer[edit]

The footer call marks the end of the navigation bar.

{{nav|footer}}
  • footer: A required parameter marking the template as the footer.

Notes on 'class' parameters[edit]

For the 'class' parameters, it is intended that a set of classes should be created to work as a particular theme for the navigation bar(s). This set of classes should include a central style class to replace navMainSeries as well as 2 classes for the alternate cell backgrounds (navMainSeriesCellBackground1 and navMainSeriesCellBackground2). These 2 classes must share the same name as the first class, with the CellBackground# portion added on for each. See the common stylesheet for more info on each class.

Other notes[edit]

The show/hide functionality is added automatically to all navigation bars via javascript. No user input is necessary. The tnav template is used to provide easy access to editing/discussion links.

Example[edit]

Sample[edit]

Code[edit]

{{nav|header|DQI|Dragon Quest|title=''Dragon Quest''}}
{{nav|section|Characters|
* [[Hero (Dragon Quest)|Hero]]
* [[Erdrick]]
}}
{{nav|section|Locations|
* [[Alefgard]]
* [[Tantegel|Brecconary]]
* [[Erdrick's Cave]]
* [[Sanctum]]
* [[Quagmire Cave]]
* [[Tantegel]]
}}
{{nav|footer}}