Predefinição:Navbox
Summary
This template allows a navigational template to be set up relatively quickly by supplying it with one or more lists of links. It comes equipped with default styles that should work for most navigational templates.
Parameters
Navbox | ||
---|---|---|
Parâmetero | Escopo | Descrição |
Main | ||
name |
required | The name of the template. |
title |
required | Text in the title bar |
state |
optional | * Defaults to autocollapse . A navbox with autocollapse will 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. For the technically minded, see MediaWiki:Common.js.
|
navbar |
optional | Currently, this is set to off until the wiki software is upgraded to handle it. |
border |
optional | If set to child or subgroup , then the navbox can be used as a borderless child that fits snugly in another navbox. |
Cells | ||
groupn |
optional | (i.e. group1, group2, etc.) If specified, text appears in a header cell displayed to the left of listn. If omitted, listn uses the full width of the table. |
listn |
required | (i.e. list1, list2, etc.) The body of the template, usually a list of links. Use {{Navbox/Line}} in order to display the links. |
image |
optional | An image to be displayed in a cell below the title and to the right of the body (the groups/lists). For the image to display properly, the list1 parameter must be specified. |
imageleft |
optional | An image to be displayed in a cell below the title and to the left of the body (lists). For the image to display properly, the list1 parameter must be specified and no groups can be specified. It accepts the same sort of parameter that image accepts. |
above |
optional | A full-width cell displayed between the titlebar and first group/list |
below |
optional | A full-width cell displayed below the template's body |
Style | ||
style |
optional | Specifies CSS styles to apply to the template body. The parameter bodystyle also does the exact same thing and can be used in place of this style parameter. This option should be used sparingly as it can lead to visual inconsistencies. |
basestyle |
optional | CSS styles to apply to the title, above, below, and group cells all at once. The styles are not applied to list cells. |
titlestyle |
optional | CSS styles to apply to title, most often the titlebar's background color. |
groupstyle |
optional | CSS styles to apply to the groupn cells. This option overrides any styles that are applied to the entire table. |
groupnstyle |
optional | CSS styles to apply to a specific group, in addition to any styles specified by the groupstyle parameter. |
groupwidth |
optional | A number and unit specifying a uniform width for the group cells, in cases where little content in the list cells may cause group cells to be too wide. |
liststyle |
optional | CSS styles to apply to all lists. Overruled by the oddstyle and evenstyle parameters (if specified) below. |
listnstyle |
optional | CSS styles to apply to a specific list, in addition to any styles specified by the liststyle parameter. |
listpadding |
optional | A number and unit specifying the padding in each list cell. The list cells come equipped with a default padding of 0.25em on the left and right, and 0em on the top and bottom. |
oddstyle |
optional | Applies to odd/even list numbers. Overrules styles defined by liststyle. The default behavior is to add striped colors (white and gray) to odd/even rows, respectively, in order to improve readability. |
evenodd |
optional | If set to swap , then the automatic striping of even and odd rows is reversed. Normally, even rows get a light gray background for striping; when this parameter is used, the odd rows receive the gray striping instead of the even rows. Setting to even or odd sets all rows to have that striping color. Setting to off disables automatic row striping. |
abovestyle |
optional | CSS styles to apply to the top cell (specified via the above parameter) and bottom cell (specified via the below parameter). Typically used to set background color or text alignment |
imagestyle |
optional | CSS styles to apply to the cells where the image/imageleft sits. |
Defaults | ||
bodystyle |
background:#fdfdfd; width:100%; vertical-align:middle; |
|
titlestyle |
background:#ccccff; padding-left:1em; padding-right:1em; text-align:center; |
|
abovestyle |
background:#ddddff; padding-left:1em; padding-right:1em; text-align:center; |
|
belowstyle |
background:#ddddff; padding-left:1em; padding-right:1em; text-align:center; |
|
groupstyle |
background:#ddddff; padding-left:1em; padding-right:1em; text-align:right; |
|
liststyle |
background:transparent; text-align:left/center; |
|
oddstyle |
background:transparent; |
|
evenstyle |
background:#f7f7f7; |
|
Since liststyle and oddstyle are transparent, odd lists have the color of the bodystyle, which defaults to #fdfdfd (white with a hint of gray). A list defaults to text-align:left; if it has a group, if not it defaults to text-align:center; . Since only bodystyle has a vertical-align all the others inherit its vertical-align:middle; . |
||
Advanced | ||
aboveclass |
optional | This enables attaching a CSS class to group or list cells. The most common use for listclass is to give it the hlist class that will cause lists to render horizontally. |
titlegroup |
optional | This puts a group in the title area, with the same default styles as groupn. |
titlegroupstyle |
optional | The styles for the titlegroup cell. |
innerstyle |
optional | A very advanced parameter to be used only for advanced meta-templates employing the navbox. Internally, the navbox uses an outer table to draw the border, and then an inner table for everything else (title/above/groups/lists/below/images, etc.). The style/bodystyle parameter sets the style for the outer table, which the inner table inherits, but in advanced cases (meta-templates) it may be necessary to directly set the style for the inner table. This parameter provides access to that inner table so styles can be applied. |
bodyclass |
optional | This parameter is inserted into the "class" attribute for the navbox as a whole. |
titleclass |
optional | This parameter is inserted into the "class" attribute for the navbox's title caption. |