Template:Nav/doc

From Dragon Quest Wiki
< Template:Nav
Revision as of 14:23, 13 July 2010 by FlyingRagnar (talk | contribs) (merged nav templates)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Usage

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

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

{{nav|header|DQI|Dragon Quest|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.
  • 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 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.
  • 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

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.

{{nav|subheader|Characters|class=navMainSeries|bg=alt}}
  • subheader: A required parameter marking the start of a subheader. 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.
  • 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.

Items

A nav item represents a single link to an article within the navigation bar.

{{nav|item|[[Dragon Quest IV]]}}
  • 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

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

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

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

Sample

Code

{{nav|header|DQI|Dragon Quest}}
{{nav|subheader|Characters}}
{{nav|item|[[Hero (Dragon Quest I)|Hero]]|nospacer=true}}
{{nav|item|[[Roto]]}}

{{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}}