Jump to content

Template:Navbox/doc: Difference between revisions

From The Petit Planet Wiki
Updated to RANGER navbox
Standardizing parameter naming convention to snake_case
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation/Header}}
{{Documentation/Header}}
{{Lua|Navbox}}
{{Lua|Navbox}}
{{CSS|Navbox}}
{{CSS|Gadget-Navbox}}
Template that creates a standard navigation box.  
Template that creates a standard navigation box.  


For full documentation: [https://support.wiki.gg/wiki/RANGER_navboxes RANGER navboxes]
* For full documentation: [https://support.wiki.gg/wiki/RANGER_navboxes RANGER navboxes]
* For the full list of supported parameters: [https://support.wiki.gg/wiki/RANGER_navboxes Template:Navbox]


==Syntax==
==Syntax==
<pre>
<syntaxhighlight lang="wikitext" copy>
{{Navbox
{{Navbox
|title =  
|title =  
|striped = even
|striped = even
|editlinks = off
|edit_link = off
|group1 =  
|group1 =  
|list1 =  
|list1 =  
Line 17: Line 18:
|list2 =  
|list2 =  
}}
}}
</pre>
</syntaxhighlight>


==Examples==
==Examples==
====Multiple subgroups====
===Multiple subgroups===
<pre>
{{Example|<nowiki>
{{Navbox
{{Navbox
|title = Items
|title = Items
|striped = even
|striped = even
|editlinks = off
|edit_link = off
|above = Some items are restricted to specific classes; see Classes for more information.
|above = Some items are restricted to specific classes; see Classes for more information.
|below = Update 1.2
|below = Update 1.2
Line 47: Line 48:
* Longbow
* Longbow
}}
}}
</pre>
</nowiki>}}


===Multiple expands/collapses in a single container===
{{Example|<nowiki>
{{Navbox
{{Navbox
|title = Items
|title = Items
|striped = even
|striped = even
|editlinks = off
|edit_link = off
|above = Some items are restricted to specific classes; see Classes for more information.
|below = Update 1.2
|below_class = align-right
 
|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
}}
 
====Multiple expands/collapses in a single container====
<pre>
{{Navbox
|title = Items
|striped = even


|header1 = Consumables
|header1 = Consumables
Line 117: Line 93:
* Wizard's Staff
* Wizard's Staff
}}
}}
</pre>
</nowiki>}}
 
{{Navbox
|title = Items
|striped = even


|header1 = Consumables
==Template Data==
|header1.1 = Potions
<templatedata>
|list1.1 =
{
* Revitalizing Potion
"params": {
* Teleport Potion
"title": {
|group1.1.1 = Health
"label": "Title",
|list1.1.1 =
"description": "Text that appears at the top of the navbox.",
* Health Potion
"type": "string",
* Large Health Potion
"suggested": true
* Elixir of Healing
},
|group1.1.2 = Mana
"striped": {
|list1.1.2 =
"label": "Striped",
* Mana Potion
"description": "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.",
* Large Mana Potion
"example": "on, yes, striped, even, odd, swap",
* Elixir of Magic
"type": "string",
|header1.2 = Scrolls
"suggested": true
|list1.2 =
},
* Scroll of Poison
"edit_link": {
 
"label": "Edit link",
|header3 = Weapons
"description": "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.",
|state3 = collapsed
"example": "off, no",
|group3 = Swords
"type": "string",
|list3 =
"default": "on"
* Wooden Sword
},
* Rusted Sword
"state": {
* Steel Sword
"aliases": [
|group4 = Bows
"collapsible"
|list4 =
],
* Shortbow
"label": "State",
* Crossbow
"description": "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.",
* Longbow
"example": "expanded, collapsed, off, no, plain",
|group5 = Staves
"type": "string",
|list5 =
"default": "expanded"
* Basic Staff
},
* Wizard's Staff
"headern": {
}}
"aliases": [
"header1",
"header2",
"header3"
],
"label": "Header n",
"description": "Text that appears at the top of the section, where n is any positive integer.",
"type": "string"
},
"groupn": {
"aliases": [
"group1",
"group2",
"group3"
],
"label": "Group n",
"description": "Text label for a list, which appears on the left on desktop or at the top on mobile, where n is any positive integer.",
"type": "string"
},
"listn": {
"aliases": [
"list1",
"list2",
"list3"
],
"label": "List n",
"description": "A wikitext list, where n is any positive integer.",
"type": "content"
},
"groupn.x": {
"aliases": [
"group1.1",
"group1.2",
"group2.1.1"
],
"label": "Group n.x",
"description": "Text label for sub-lists that appear under groupn, groupn.x, etc.",
"type": "string"
},
"listn.x": {
"aliases": [
"list1.1",
"list1.2",
"list2.1.1"
],
"label": "List n.x",
"description": "Wikitext sub-lists.",
"type": "content"
}
},
"description": "Template that creates a standard navigation box.",
"format": "block",
"paramOrder": [
"title",
"striped",
"edit_link",
"state",
"headern",
"groupn",
"listn",
"groupn.x",
"listn.x"
]
}
</templatedata>

Latest revision as of 10:29, 4 May 2026

This is the documentation page for Navbox.
It contains usage information, categories, and other content not part of the original template page.
This template uses Module:Navbox, a script written in Lua.
This template uses CSS found at MediaWiki:Gadget-Navbox.css.

Template that creates a standard navigation box.

Syntax

[edit source]
{{Navbox
|title = 
|striped = even
|edit_link = off
|group1 = 
|list1 = 
|group2 = 
|list2 = 
}}

Examples

[edit source]

Multiple subgroups

[edit source]

{{Navbox
|title = Items
|striped = even
|edit_link = off
|above = Some items are restricted to specific classes; see Classes for more information.
|below = Update 1.2
|below_class = align-right

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

Multiple expands/collapses in a single container

[edit source]

{{Navbox
|title = Items
|striped = even
|edit_link = off

|header1 = Consumables
|header1.1 = Potions
|list1.1 =
* Revitalizing Potion
* Teleport Potion
|group1.1.1 = Health
|list1.1.1 =
* Health Potion
* Large Health Potion
* Elixir of Healing
|group1.1.2 = Mana
|list1.1.2 =
* Mana Potion
* Large Mana Potion
* Elixir of Magic
|header1.2 = Scrolls
|list1.2 =
* Scroll of Poison

|header3 = Weapons
|state3 = collapsed
|group3 = Swords
|list3 =
* Wooden Sword
* Rusted Sword
* Steel Sword
|group4 = Bows
|list4 =
* Shortbow
* Crossbow
* Longbow
|group5 = Staves
|list5 =
* Basic Staff
* Wizard's Staff
}}

Template Data

[edit source]

Template that creates a standard navigation box.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Titletitle

Text that appears at the top of the navbox.

Stringsuggested
Stripedstriped

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.

Example
on, yes, striped, even, odd, swap
Stringsuggested
Edit linkedit_link

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.

Default
on
Example
off, no
Stringoptional
Statestate collapsible

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.

Default
expanded
Example
expanded, collapsed, off, no, plain
Stringoptional
Header nheadern header1 header2 header3

Text that appears at the top of the section, where n is any positive integer.

Stringoptional
Group ngroupn group1 group2 group3

Text label for a list, which appears on the left on desktop or at the top on mobile, where n is any positive integer.

Stringoptional
List nlistn list1 list2 list3

A wikitext list, where n is any positive integer.

Contentoptional
Group n.xgroupn.x group1.1 group1.2 group2.1.1

Text label for sub-lists that appear under groupn, groupn.x, etc.

Stringoptional
List n.xlistn.x list1.1 list1.2 list2.1.1

Wikitext sub-lists.

Contentoptional