Jump to content

Template:Navbox/doc

From The Perfect Tower II

A navigation box for the bottom of articles: a title bar over rows of links, which readers can collapse. Module:Navbox draws it (a 2019 copy of Wikipedia's Navbox) and MediaWiki:Common.css styles it in the brand kit's colors. Build each navbox as a template of its own, such as Template:Navbox buildings, and put that template on the articles.

Usage

{{Navbox
| name      = Navbox buildings
| title     = Buildings
| listclass = hlist
| state     = {{{state|}}}
| list1     =
* [[Power Plant]]
* [[Mine]]
}}

Parameters

  • name: the navbox template's name without Template:. It adds the view, talk and edit links (Module:Navbar); navbar = off removes them.
  • title: the title bar. Without a title the box can't collapse. above and below add full-width rows over and under the lists.
  • list1, list2, …: the rows, usually bulleted lists. group1, group2, …: a label to the left of the row with the same number.
  • listclass = hlist: shows the lists as horizontal lists. Without it (or plainlist), the template page gets a tracking category.
  • state: autocollapse (default; collapsed when the page has two or more collapsible elements), collapsed, expanded, or plain for no collapse button. Pass state = {{{state|}}} on, so articles can choose.
  • image and imageleft: an image to the right or left of the lists. border = child puts a navbox inside a list of another one. nocat turns off the tracking categories.
  • bodyclass, style, titlestyle, groupstyle, liststyle and the other *class and *style parameters add classes and CSS. Colors set this way don't follow the light and dark themes.