RuneScape:Style guide/Navboxes

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
Shortcut:

The navbox style guide is a set of guidelines to use while creating and editing navboxes. These guidelines are here to keep the wiki code of the navboxes clean and consistent.

Usage[edit source]

Navboxes should be used both ways, a navbox should contain a link to the article that uses the navbox and the article should transclude the navbox template.

  • Do not include redirect or disambiguation pages, use direct links.
  • Do not use navboxes on redirect or disambiguation pages.
  • A navbox can be created if it has at least 3 links.
  • Do not link (sub)group titles unless they are relevant for the navbox, e.g. on Template:Summoning familiars all summoning familiars should be linked, however the charms should not be linked as they are not familiars.

Parameters[edit source]

All navboxes start with '{{Navbox' with Navbox capitalised and on the first line of the template. The final '}}' should be on a separate line at the end of the template.

  • name should always match the name of the navbox without 'Template:'
  • title has to be a proper description of the navbox contains, e.g. Perks for {{Perks}}

For the other parameters see Template:Navbox/doc.

Categories[edit source]

Navboxes that give a category to the articles that use the navbox should use '{{Ctg|Name of category}}' on the same line as the final '}}'. A navbox itself can also have a category which is added with '{{Template only|[[Category:Name of category]]}}'. Notice the difference that {{Ctg}} does not need 'Category:' in the name of the category, but that {{Template only}} does require the full link.

}}{{Ctg|Name of category}}{{Template only|[[Category:Name of template category]]}}

Individual groups of the navbox can also have their own categories which are subsequently only transcluded by the pages linked in that group when those pages also have this navbox. For example:

  • Navbox artefacts has two groups:
    • One group for damaged artefacts
    • One group for restored artefacts
  • The navbox has a category for artefacts
  • The group for damaged artefacts also has the damaged artefacts category
  • The navbox has been added to both 'Damaged artefact 1' and 'Restored artefact 1'
{{Navbox
|name = Artefacts
|title = [[Artefacts]]
|gtitle1 = Damaged artefacts
|g1cat1 = Damaged artefacts
|group1 =
 * [[Damaged artefact 1]]
|gtitle2 = Restored artefacts
|group2 =
 * [[Restored artefact 1]]
}}{{Ctg|Artefacts}}{{Template only|[[Category:Archaeology templates]]}}

This will result in 'Damaged artefact 1' and 'Restored artefact 1' both having the 'Artefacts' category and 'Damaged artefact 1' will also have the 'Damaged artefacts' category.

White-spacing[edit source]

  • Do not allow trailing spaces at the end of lines.
  • A space should be placed between each parameter and its value, e.g. parameter = value
  • Do not add a space between | and the parameter, e.g. |gtitle1
  • The exception is parameters that have a list as a value as demonstrated below:
|gtitle1 = Name of first group
|group1 =<!--no space here-->
 * [[Link]]

Group alignment[edit source]

When adding a subgroup to a navbox, do not forget to add an indent of 2 spaces. This also counts for subgroups within subgroups, these add an extra indentation of 2 spaces, e.g. when a subgroup has a subgroup that inner subgroup will have an indentation of 4 spaces. Write values for 'gtypeX' and 'subgroup' with a small letter, e.g. 'subgroup' and 'yes' instead of 'Subgroup' and 'Yes', respectively. A list of values for the parameter 'groupX' always have one space as an indentation, list values within subgroup will have a 3 space-indentation and list values within subgroups within another subgroup will have a 5 space-indentation, etc.

{{Navbox
|name = Name of navbox
|title = Title of navbox
|gtitle1 = Name of first group
|gtype1 = subgroup
|group1 =
  {{Navbox
  |subgroup = yes
  |gtitle1 = Subgroup 1
  |gtype1 = subgroup
  |group1 =
    {{Navbox
    |subgroup = yes
    |gtitle1 = Subgroup within subgroup
    |group1 =
     * [[Link]]
    }}
  |gtitle2 = Another subgroup
  |group2 =
   * [[Link]]
  }}
}}

Inline templates[edit source]

Inline templates should not have spaces between the pipe ('|') symbol and the parameter name (or value), nor before or after the '=' sign.

{{plink|VALUE1|pic=VALUE2|txt=VALUE3}}
{{chatl|VAL1|pic=VAL2|txt=VAL3}}

Helpful templates[edit source]

  • {{plink}}, for items with an inventory sprite
  • {{chatl}}, for NPCs that have a chathead image
  • {{emote link}}, for emotes that have an emote icon
  • {{QuestIcon}}, for links to quests

Parameter value list[edit source]

There should be a single space between the list character (*) and the content of that list item.

* [[List item 1]]
* [[List item 2]]

In case a link has a sublink, use <sup>([[sublink]])</sup> to add it behind the link with a space between the link and the <sup> tag. Add the "()"-signs outside the link and not within the alternative text of a link.

* {{plink|Ring of charos}} <sup>([[Ring of charos (a)|Activated]])</sup>

In case a link has two or more sublinks, use {{*}} to seperate the values inline. Do not use plink for the sublinks.

* {{plink|Ardougne cloak|pic=Ardougne cloak 1}} <sup>([[Ardougne cloak 1|1]] {{*}} [[Ardougne cloak 2|2]])</sup>

Centering a group[edit source]

A group without a 'gtitleX' can be centered with |style1 = text-align:center;. It should be noted that groups with 'gtitleX' can also be centered technically, but usually are not. This is usually the first group within a navbox for the main links or for navboxes with just one group.

Example navbox[edit source]

Below is an example of the above guidelines in action, for a stub version of an average navbox.

{{Navbox
|name = Name of navbox
|title = Title of navbox
|gtitle1 = Name of first group
|group1 =
 * [[Link]]
}}{{Ctg|Category}}