Help:Editing/Navbox

From the Tesseract Wiki, the wiki for all things Marvel Cinematic Universe
Jump to navigation Jump to search
Information icon.svg This guide is written for use with the Source Mode editor.
If you have not already switched to the Source Mode editor you can find out how to here.

This page is an introduction to editing and creating navboxes to help users learn how to edit and format navbox templates. Navbox templates are navigational templates found at the bottom of the articles. If you want to learn how to add a template to a page, see here.

Starting simple

  • Start a navbox with {{Navbox on the first line and end it with a }} on the last line of the template
  • On the second line add its name with |name = Name of the navbox, this has to be equal to the name of the template, e.g. the name of Template:Realms is Realms (the link to the template without Template:)
  • On the next line add a title to display at the top of the navbox with |title = [[Title of the navbox]], this is often used to link to the navbox's main content article, e.g. Realms
  • On the next line add the group parameter to start a group to display links in with |groupX =, e.g. the first group will be |group1 =
  • On the next line add content to the group by adding an indent of 1 space followed by a * followed by another space followed by the link, e.g. * [[Some link]]
Markup Renders as
{{Navbox
|name = Realms
|title = [[Realms]]
|group1 =
 * [[Vormir]]
}}

Centring the group

  • It's common for a navbox with one group to center the group with |styleX = text-align:center; with X being the number of the group, in this case being 1
  • It's also common for groups without a gtitleX parameter (see next section) to be centered
  • It's also possible to center all content of the navbox with |style = text-align:center;, so style without a number
Markup Renders as
{{Navbox
|name = Realms
|title = [[Realms]]
|style1 = text-align:center;
|group1 =
 * [[Vormir]]
}}

Adding a title to the group

  • Groups can also have titles, this is done by adding gtitleX with X being the number of the group, e.g. |gtitle1 = Pets
  • It's common for group with a gtitleX parameter to not be centered, although it is technically possible
Markup Renders as
{{Navbox
|name = Realms
|title = [[Realms]]
|gtitle1 = Planets
|group1 =
 * [[Vormir]]
}}

Adding a second group

  • A second group can easily be added just like the first group, start it on a new line after the contents of the first group
  • There is a maximum of 20 groups in a navbox (not counting subgroups, but those also have the same limit), e.g. a navbox can have 20 groups with 3 of them having an X amount of subgroups
  • All group parameters (gtitleX, styleX, gtypeX, groupX) also have the same number per group (with X being the number in this example)
    • It starts with group1 (there is no group0)
Markup Renders as
{{Navbox
|name = Realms
|title = [[Realms]]
|gtitle1 = Planets
|group1 =
 * [[Vormir]]
|gtitle2 = Nine Realms
|group2 =
 * [[Asgard]]
}}

Adding a subgroup

  • Add gtypeX = subgroup in the parent group above the groupX parameter
  • Add a subnavbox with an indent of 2 spaces
  • Instead of adding the name and title parameters, add the following parameter: |subgroup = yes
  • Continue as if it is a normal navbox with groups (or even deeper subgroups)
    • It's normal for a navbox to have a maximum of 2 subgroups deep (subgroup in a subgroup in a group), however deeper subgroups do exist, but are not recommended
Markup Renders as
{{Navbox
|name = Realms
|title = [[Realms]]
|style1 = text-align:center;
|group1 =
 * [[Vormir]]
|gtitle2 = Nine Realms
|gtype2 = subgroup
|group2 =
  {{Navbox
  |subgroup = yes
  |gtitle1 = Former
  |group1 =
   * [[Asgard]]
  |gtitle2 = Current
  |group2 =
   * [[Earth]]
  }}
}}

Categories

  • To add a category to a navbox so the category is transcluded from the navbox onto the articles that use the navbox, the following can be used: {{Ctg|Name of the category}}
  • Navbox templates themselves can also have a category by adding: {{Template only|[[Category:Name of a navbox category]]}}
  • The above two templates are added at the end of the template on the same line as the closing }} as shown below
Markup Renders as
{{Navbox
|name = Realms
|title = [[Realms]]
|style1 = text-align:center;
|group1 =
 * [[Vormir]]
}}{{Ctg|Realms}}{{Template only|[[Category:Planet templates]]}}

See also

Want some more help?