Template:Navbox/doc
Jump to navigation
Jump to search
See the support wiki for more information, including installation steps and further examples.
{{Navbox
| template =
| title = Items | striped = even
| group1 = Consumables | list1 =
| group2 = Weapons
| group2.1 = Swords | list2.1 =
| group2.2 = Bows | list2.2 =
To assist with text alignment, three default classes are available:
Don't call this template directly from any content page!
This template is intended to be used inside of another template. Then that template in turn may be used on content pages.
- REDIRECT Template:Uses Lua
See the support wiki for more information, including installation steps and further examples.
Basic example
The following example demonstrates the core functionality of this template: the title text, one standard link group, and one link group that contains two sub-groups. The rows are striped for easier readability.| title = Items | striped = even
| group1 = Consumables | list1 =
- Health Potion
- Mana Potion
| group2 = Weapons
| group2.1 = Swords | list2.1 =
- Wooden Sword
- Rusted Sword
- Steel Sword
| group2.2 = Bows | list2.2 =
- Shortbow
- Crossbow
- Longbow
Parameters
Main
The following parameters modify the navbox as a whole.| Parameter | Description |
|---|---|
templatename | (Required) Title of the template that the edit icon links to. e.g. Items for template:Items. |
title | Text that appears at the top of the navbox. |
statecollapsible | Controls if a navbox should be expanded or collapsed when the page loads. This only affects the whole navbox; if sections are used, they are treated differently.
|
editlinks | Controls if an edit icon should be displayed at the top-left of the navbox, making it easier for users to interact with the template itself.
|
above | Text that appears above all list groups, directly below the title. |
below | Text that appears below all list groups, at the bottom of the navbox. |
stripedevenodd | Controls if the navbox rows should have zebra striping on even or odd rows, making it easier for users to distinguish two rows apart from each other. If sections are used, each section resets the even/odd counter.
|
Sections
The following parameters define sections within the navbox with their own titles.| Parameter | Description |
|---|---|
headern | Text that appears at the top of the section, where n is any positive integer. If the value is set to two or more - (e.g. --, -----, etc.) the new section will have no header bar and cannot be collapsed.
All groups and lists that are n or higher will appear in this section unless there is a higher headern later in the template. For example, if a navbox defines header1 and header4, the first section will include list1, list2, and list3 (and any of their sub-lists), while the second section will include all remaining lists starting at list4 and their sub-lists.
|
header_statestaten | header_state controls if all sections, by default, should be expanded or collapsed when the page loads.
staten overrides header_state for the specific section defined by headern (where n is a matching integer).
Both parameters have no effect on sections with headers set to two or more -, which are always expanded and cannot be collapsed.
|
List groups
The following parameters define the list groups.| Parameter | Description |
|---|---|
groupn | Text label for a list, which appears on the left on desktop or at the top on mobile, where n is any positive integer.
This parameter is optional; if a listn does not have a matching groupn, the list will take the full width on desktop.
|
listn | A wikitext list, where n is any positive integer. |
groupn.xgroupn.x.yetc. | Text label for sub-lists that appear under groupn, groupn.x, etc. |
listn.xlistn.x.yetc. | Wikitext sub-lists. |
Styling
The following parameters add inline styling or your custom CSS classes to specific elements of the navbox.To assist with text alignment, three default classes are available:
align-left, align-center, and align-right.
| Parameter | Description |
|---|---|
navbox_stylenavbox_class | Modifies the parent navbox element; class can be used as a shorthand for navbox_class
Two default classes are available:
|
title_styletitle_class | Modifies the title bar |
above_styleabove_class | Modifies the above text row |
below_stylebelow_class | Modifies the below text row |
header_styleheader_class | Modifies all section headers (not the title bar) |
headern_styleheadern_class | Modifies the specific section header n |
sectionn_stylesectionn_class | Modifies the container holding the section defined by a matching headern |
group_stylegroup_class | Modifies all base groups (groupn), but not any subgroups (groupn.x, etc.) |
subgroup_stylesubgroup_class | Modifies all subgroups at all levels (groupn.x, groupn.x.y, etc.) |
groupA_stylegroupA_class | Modifies the specific group A, where A is any n, n.x, n.x.y, etc. |
list_stylelist_class | Modifies all lists. Note, in this context, "list" refers to the container of a listn parameter, not a ul or ol element inside the parameter |
listA_stylelistA_class | Modifies the specific list A, where A is any n, n.x, n.x.y, etc. |