Help:Editing/Navbox
Jump to navigation
Jump to search
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 isRealms
(the link to the template withoutTemplate:
) - 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;
withX
being the number of the group, in this case being1
- 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;
, sostyle
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
withX
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 thegroupX
parameter - Add a subnavbox with an indent of 2 spaces
- Instead of adding the
name
andtitle
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
- For more detailed information about navboxes see its documention: Template:Navbox/doc
- Tesseract:Style guide/Navboxes
- Want some more help?
- Ask for help with this topic on the article's talk page.
- Ask for general editing help at Tesseract:User help.
- Request help from an administrator at Tesseract:Administrative requests if you need help which requires an administrator's tools.
- Chat to other editors in our Discord channel.
Articles | |
---|---|
Images | |
Advanced | |
Community |