Jump to content

Editing Template:Navbox/doc

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{Documentation/Header}}
{{Documentation/Header}}
{{Lua|Navbox}}
{{CSS|Navbox|Colors}}
{{CSS|Gadget-Navbox}}
Base template for all Navboxes.
Template that creates a standard navigation box.  


* For full documentation: [https://support.wiki.gg/wiki/RANGER_navboxes RANGER navboxes]
==Syntax==
* For the full list of supported parameters: [https://support.wiki.gg/wiki/RANGER_navboxes Template:Navbox]
{|class="article-table" style="width:100%;"
|-
!Parameter(s)
!Usage
!style="width:10%;" | Default value(s)
|-
|{{{name}}}
|Should be identical to the template's name without namespace.
|{{{name}}}
|-
|{{{title}}}
|Sets the title used at the top of the navbox.
|{{{title}}}
|-
|{{{state}}}
|Allows you to change the collapsing state of the table. [[mw:Manual:Collapsible elements#Common.js script (Before 1.18)|More info]]. Collapsed is removed while on pages in the Template namespace, to make editing easier.
|collapsible
|-
|{{{titleclass}}}
|Set the css class used for the title area.
|''None''
|-
|{{{titlestyle}}}
|Allows custom styling for the title area.
|''None''
|-
|{{{bodyclass}}}
|Set the css class used for the body area.
|''None''
|-
|{{{bodystyle}}}
|Allows custom styling for the body area.
|''None''
|-
|{{{groupclass}}}
|Set the css class used for the group area.
|''None''
|-
|{{{groupstyle}}}
|Allows custom styling for the group area.
|''None''
|-
|{{{listclass}}}
|Set the css class used for the list area.
|''None''
|-
|{{{liststyle}}}
|Allows custom styling for the list area.
|''None''
|-
|{{{evenodd}}}
|Can be set to "swap" to reverse the order of styling among lists (starts with even by default).
|''None''
|-
|{{{1}}}
|Can be set to "child" or "subgroup" to use styling intended for nested navboxes.
|''None''
|-
|{{{group1-20}}}
|Adds the heading for the group number specified.
|{{{group1}}} = {{{group1}}}<br />{{{group2-20}}} = ''None''
|-
|{{{list1-20}}}
|Adds text for the list number specified.
|{{{list1}}} = {{{list1}}}<br />{{{list2-20}}} = ''None''
|}


==Syntax==
==Sample output==
<syntaxhighlight lang="wikitext" copy>
<pre>
{{Navbox
{{Navbox
|title =  
|name      = Navbox
|striped = even
|title    = Navbox
|edit_link = off
|bodyclass = hlist
|group1 =
|list1 =
|group2 =  
|list2 =  
}}
</syntaxhighlight>


==Examples==
|group1    = Group 1
===Multiple subgroups===
|list1    = List 1
{{Example|<nowiki>
{{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
|group2    = Group 2
|list1 =
|list2    =
* Health Potion
  {{Navbox|child
* Mana Potion
  |evenodd = swap
  |group1 = Group 2.1
  |list1   = List 2.1
  |group2  = Group 2.2
  |list2  = List 2.2
  |group3  = Group 2.3
  |list3  = List 2.3
  }}


|group2 = Weapons
|group3    = Group 3
|group2.1 = Swords
|list3    =
|list2.1 =
* List 3
* Wooden Sword
* List
* Rusted Sword
* List
* Steel Sword
|group2.2 = Bows
|list2.2 =
* Shortbow
* Crossbow
* Longbow
}}
}}
</nowiki>}}
</pre>
{{Navbox
|name      = Navbox
|title    = Navbox
|bodyclass = hlist


===Multiple expands/collapses in a single container===
|group1    = Group 1
{{Example|<nowiki>
|list1    = List 1
{{Navbox
|title = Items
|striped = even
|edit_link = off


|header1 = Consumables
|group2    = Group 2
|header1.1 = Potions
|list2    =  
|list1.1 =
  {{Navbox|child
* Revitalizing Potion
  |evenodd = swap
* Teleport Potion
  |group1 = Group 2.1
|group1.1.1 = Health
  |list1   = List 2.1
|list1.1.1 =
  |group2  = Group 2.2
* Health Potion
  |list2  = List 2.2
* Large Health Potion
  |group3  = Group 2.3
* Elixir of Healing
  |list3  = List 2.3
|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
|group3   = Group 3
|state3 = collapsed
|list3     =
|group3 = Swords
* List 3
|list3 =
* List
* Wooden Sword
* List
* Rusted Sword
* Steel Sword
|group4 = Bows
|list4 =
* Shortbow
* Crossbow
* Longbow
|group5 = Staves
|list5 =
* Basic Staff
* Wizard's Staff
}}
}}
</nowiki>}}
==Template Data==
<templatedata>
{
"params": {
"title": {
"label": "Title",
"description": "Text that appears at the top of the navbox.",
"type": "string",
"suggested": true
},
"striped": {
"label": "Striped",
"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.",
"example": "on, yes, striped, even, odd, swap",
"type": "string",
"suggested": true
},
"edit_link": {
"label": "Edit link",
"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.",
"example": "off, no",
"type": "string",
"default": "on"
},
"state": {
"aliases": [
"collapsible"
],
"label": "State",
"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.",
"example": "expanded, collapsed, off, no, plain",
"type": "string",
"default": "expanded"
},
"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>
Please note that all contributions to The Petit Planet Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see Petit Planet Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template
Below are commonly used wikitext from MediaWiki:Edittools. Click on any to insert them in the edit box.
File Pages==Summary====Licensing=={{Fairuse}}{{File|}}
Dynamic Page List¦²«»²{¦}²«»«/»«!----»
Array in DPL¹^2{}^2^2{¹}^2
Parser Functions{{#if:||}}
{{#ifeq:|||}}
{{#expr:}}
{{#switch:||#default=}}
{{#replace:||}}
{{#titleparts:}}
{{#tag:|}}
Markup{{}}|[][[]][[Category:]]#REDIRECT [[]] [[Category:Redirect Pages]]<code></code><includeonly></includeonly><noinclude></noinclude><nowiki></nowiki><!----><br>§
Notices{{Stub|}}{{Stub Dialogue}}{{Upcoming}}{{Under Construction}}{{Placeholder|}}
Magic Words{{!}}{{formatnum:}}{{lc:}}{{uc:}}{{PAGENAME}}{{FULLPAGENAME}}{{ROOTPAGENAME}}{{BASEPAGENAME}}{{SUBPAGENAME}}{{DISPLAYTITLE:|noreplace}}__TOC____NOTOC____EXPECTUNUSEDCATEGORY____HIDDENCAT__
HTML Entities&mdash;&nbsp;&comma;&shy;