On Fanlore, users with accounts can edit pages including user pages, can create pages, and more. Any information you publish on a page or an edit summary will be accessible by the public and to Fanlore personnel. Because Fanlore is a wiki, information published on Fanlore will be publicly available forever, even if edited later. Be mindful when sharing personal information, including your religious or political views, health, racial background, country of origin, sexual identity and/or personal relationships. To learn more, check out our Terms of Service and Privacy Policy. Select "dismiss" to agree to these terms.
Template:Navbox
Overview
This template creates navboxes, navigation templates that provide a flat list of links to related articles at the bottom of a page. This is a metatemplate, meaning it is used to create individual navboxes that are then included in articles.
Usage
The most basic implementation of a navbox template is:
{{Navbox | name = {{subst:FULLPAGENAME}}{{subst:void|Don't change anything on this line. It will change itself when you save.}} | title = | listclass = hlist | state = {{{state|}}} | group1 = | list1 = | group2 = | list2 = | group3 = | list3 = <!-- ... --> | below = }}<noinclude> {{documentation}} <!-- add template here --> </noinclude>
Parameter list
|name=
: The internal name/Fanlore location of the template. This must always be the direct page name of the template and left unedited.|title=
: The header text that appears at the top of a navbox. Most often, this is an internal link to the main page of a navbox's subject.|listclass=
: The CSS class that lists in the navbox should use. This should usually be left at "hlist".|state=
: Controls when a navbox is expanded or collapsed (accepted values: "autocollapsed", "uncollapsed", "collapsed", "plain", "off" -- more info here). Using {{{state|}}} allows editors to determine if the template should be expanded or collapsed on a per-page basis by using state when calling the navbox. Can be left blank.|group=
: The collection name for a group of links. This must always be specified with a number (e.g.|group1=
,|group2=
,|group3=
...) and paired with a corresponding list parameter. Optional.|list=
: A list of internal links to other articles. This must always be specified with a number (e.g.|list1=
...|list2=
...|list3=
...) and paired with a corresponding group parameter. list arguments should either be a flatlist of links formatted with{{Flatlist}}
, or a navbox subgroup by using{{Navbox|subgroup}}
. See Example 2 below for a demonstration. Optional.- Navbox subgroups are used to nest groups of links. They only accept
|group=
,|list=
and|evenodd=
. |evenodd=
: Overrides the automatic striping of even and odd rows. Accepts swap, even, odd or off. Optional.
- Navbox subgroups are used to nest groups of links. They only accept
|below=
: The footer text that appears at the bottom of a navbox. Optional.
- Style parameters: there are several style parameters that let you set CSS style for elements of the navbox. See the example below for those commonly used to design navboxes on Fanlore, or see MediaWiki's Navbox documentation for a full list of available parameters. Optional.
Example
Example 1
{{Navbox | name = {{subst:FULLPAGENAME}} | title = [[Baldur's Gate III]] | listclass = hlist | state = {{{state|}}} | bodystyle = background: #fdfdfd; width: 100%; vertical-align: middle; | titlestyle = background: #bda964; padding-left: 1em; padding-right: 1em; text-align: center; font-size: 125%; | abovestyle = background: #bda964; padding-left: 1em; padding-right: 1em; text-align: center; | belowstyle = background: #bda964; padding: 3px; text-align: center; font-size: 110%; | groupstyle = background: #d8c991; padding-left: 1em; padding-right: 1em; text-align: center; width: 20%; | liststyle = background: transparent; text-align: center; | oddstyle = background: #e9deb5; | evenstyle = background: #e9deb5; | group1 = Characters | list1 = {{Flatlist| * [[Astarion]] * [[Gale (Baldur's Gate)|Gale]] * [[Karlach]] * [[Lae'zel]] * [[Shadowheart]] * [[Tav]] * [[The Dark Urge]] * [[Wyll]] * [[:Category:Baldur's Gate Characters|more]] }} | group2 = Relationships | list2 = {{Flatlist| * [[Astarion/Tav]] * [[Astarion/Gale]] * [[Astarion/Halsin]] * [[Astarion/Wyll]] * [[Astarion/The Dark Urge]] * [[Gale/Tav]] * [[The Dark Urge/Enver Gortash]] * [[Shadowheart/Tav]] * [[Halsin/Tav]] * [[Lae'zel/Shadowheart]] * [[:Category:Baldur's Gate Relationships|more]] }} | group3 = Other | list3 = {{Flatlist| * [[Batstarion]] * [[Goostarion]] * [[Neil Newbon]] * [[Wavemother's Robe]] }} | below = '''Part of the [[FanloreProject:About|Fanlore Project]] on Baldur's Gate! [[FanloreProject:Baldur's Gate|Join us]], [[FanloreProject talk:Baldur's Gate|say hello on the talk page]], or [https://bit.ly/FanloreDiscord join our Discord]!''' }}
Gives this navbox:
Explanation of the formatting choices, from the Baldur's Gate III FanloreProject members: |
---|
|
(Sidenote: if you are setting up a navbox for a Fanlore Project, you may want to see Help:Starting a FanloreProject.)
Example 2
An example of a Navbox that uses default CSS styles (and therefore leaves off all style parameter fields) but also uses Navbox subgroups:
{{Navbox | name = {{subst:FULLPAGENAME}} | title = ''[[Undertale]]'' | listclass = hlist | state = {{{state|}}} | group1 = Characters | list1 = {{Flatlist| * [[Alphys]] * [[Chara]] * [[Asgore Dreemurr]] * [[Asriel Dreemurr]] * [[Flowey]] * [[Frisk]] * [[W.D. Gaster]] * [[Mad Dummy]] * [[Mettaton]] * [[Monster Kid]] * [[Muffet]] * [[Napstablook]] * [[Papyrus]] * [[Sans]] * [[Toriel]] * [[Undyne]] }} | group2 = Relationships | list2 = {{Navbox|subgroup | evenodd = swap | group1 = Het | list1 = {{Flatlist| * [[Asgore/Toriel]] * [[Sans/Toriel]] }} | group2 = M/M | list2 = {{Flatlist| * [[Mettaton/Papyrus]] * [[Sans/Sans]] * [[Sans/Papyrus]] }} | group3 = F/F | list3 = {{Flatlist| * [[Alphys/Undyne]] }} | group4 = Gen | list4 = {{Flatlist| * [[Papyrus & Sans]] }} | group5 = Other | list5 = {{Flatlist| * [[Chara/Asriel]] * [[Chara/Frisk]] * [[Frisk/Asriel]] * [[Sans/Frisk]] * [[Sans/Ketchup]] }} }} | group3 = Fanworks | list3 = {{Flatlist| * ''[[Building Bridges]]'' * ''[[Fallen Down]]'' * [[Underfell]] * ''[[Underpin]]'' }} | group4 = Other | list4 = [[Kimi no Sentaku.]] | group5 = Related | list5 = {{Flatlist| * ''[[Deltarune]]'' * [[Toby Fox]] * [[Hato Moa]] }} }}
gives a navbox that looks like this:
Copyright
This page uses content originally from Wikipedia's Template:Navbox page; Wikipedia content is licensed under a Creative Commons Attribution-ShareAlike License 4.0. (view page authors).
|