Tesseract:Style guide/Navboxes

From the Tesseract Wiki, the wiki for all things Marvel Cinematic Universe
Jump to navigation Jump to 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.

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.

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.

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.

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.

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

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