More actions
mNo edit summary |
m Added additional style parameters; they should be used sparingly too |
||
| Line 7: | Line 7: | ||
;Syntax | ;Syntax | ||
<pre>{{Navbox | <pre>{{Navbox | ||
|name = {{subst:PAGENAME}} | |name = {{subst:PAGENAME}} | ||
|title = | |title = | ||
|titleclass = | |titleclass = | ||
|state = | |state = | ||
|bodyclass = | |||
|bodystyle = | |||
|innerstyle = | |||
|basestyle = | |||
|titlestyle = | |titlestyle = | ||
|groupstyle = | |groupstyle = | ||
|titlegroupstyle = | |||
|image = | |image = | ||
|imagestyle = | |||
|imageleft = | |imageleft = | ||
|imageleftstyle = | |||
|above = | |above = | ||
|abovestyle = | |||
|liststyle = | |||
|group1 = | |group1 = | ||
| Line 28: | Line 36: | ||
|below = | |below = | ||
|belowstyle = | |||
}}</pre> | }}</pre> | ||
; Parameters | ; Parameters | ||
The only mandatory parameters are <code>name</code>, <code>title</code> and <code>list1</code> | The only mandatory parameters are <code>name</code>, <code>title</code> and <code>list1</code>. Use all style parameters sparingly! | ||
:<code>name</code> | :<code>name</code> | ||
:: The name of the template. Set to <nowiki>{{subst:PAGENAME}}</nowiki> by default. | :: The name of the template. Set to <nowiki>{{subst:PAGENAME}}</nowiki> by default. | ||
| Line 46: | Line 53: | ||
::* If set to <code>plain</code>, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered. | ::* If set to <code>plain</code>, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered. | ||
::* If set to <code>off</code>, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden. | ::* If set to <code>off</code>, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden. | ||
:<code>bodyclass</code> | |||
:: Applies an HTML <code>class</code> attribute to the entire navbox. Use sparingly! | |||
:<code>titlestyle</code> | :<code>titlestyle</code> | ||
:: A CSS style for the title-bar, such as: <code>background:gray;</code> Use sparingly! | :: A CSS style for the title-bar, such as: <code>background:gray;</code> Use sparingly! | ||
Revision as of 17:10, 11 May 2022
- Description
- This template allows a navigational template to be set up relatively quickly by supplying it one or more lists of links.
- It comes equipped with default styles that should work for most navigational templates. Changing the default styles is not recommended, but is possible.
- Dependencies
- Syntax
{{Navbox
|name = {{subst:PAGENAME}}
|title =
|titleclass =
|state =
|bodyclass =
|bodystyle =
|innerstyle =
|basestyle =
|titlestyle =
|groupstyle =
|titlegroupstyle =
|image =
|imagestyle =
|imageleft =
|imageleftstyle =
|above =
|abovestyle =
|liststyle =
|group1 =
|list1 =
|group2 =
|list2 =
...
|group20 =
|list20 =
|below =
|belowstyle =
}}
- Parameters
The only mandatory parameters are name, title and list1. Use all style parameters sparingly!
name- The name of the template. Set to {{subst:PAGENAME}} by default.
title- Text in the title bar.
titleclass- Applies an HTML
classattribute to the title bar. Use sparingly!
- Applies an HTML
state = [autocollapse, collapsed, expanded, plain, off]- The status of box expansion. Use sparingly!
- Defaults to
autocollapse. A navbox withautocollapsewill start out collapsed if there are two or more tables on the same page that use other collapsible tables. Otherwise, the navbox will be expanded. - If set to
collapsed, the navbox will always start out in a collapsed state. - If set to
expanded, the navbox will always start out in an expanded state. - If set to
plain, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered. - If set to
off, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden.
- Defaults to
- The status of box expansion. Use sparingly!
bodyclass- Applies an HTML
classattribute to the entire navbox. Use sparingly!
- Applies an HTML
titlestyle- A CSS style for the title-bar, such as:
background:gray;Use sparingly!
- A CSS style for the title-bar, such as:
groupstyle- A CSS style for the group-cells, such as:
background:#eee;Use sparingly!
- A CSS style for the group-cells, such as:
image- An optional right-side image, coded as the whole image. Typically it is purely decorative, so it should be coded as
[[File:XX.jpg|90px|link=|alt=]]. Use sparingly!
- An optional right-side image, coded as the whole image. Typically it is purely decorative, so it should be coded as
imageleft- An optional left-side image (code the same as the "image" parameter). Use sparingly!
above- Text to appear above the group/list section (could be a list of overall wikilinks).
groupn- The left-side text before list-n (if group-n omitted, list-n starts at left of box).
listn- Text listing links. See Template:Flatlist.
below- Optional text to appear below the group/list section.
- Sample output
{{Navbox
|name = {{subst:PAGENAME}}
|title = Navigational box title
|above = Text written below the title and above the link lists.
|group1 = Group One
|list1 = {{flatlist|
* [[EVE University]]
* [[EVE University Management]]
* [[EVE University Rules]]
}}
|group2 = Group Two
|list2 = {{flatlist|
# [[EVE University]]
# [[EVE University Management]]
# [[EVE University Rules]]
}}
|group20 = Group Twenty
|list20 = {{flatlist|
* [[EVE University]]
** [[EVE University Management]]
** [[EVE University Rules]]
}}
|below = Text written below the link lists.
}}
- gives...
| |||||||||||||||||
- See also