Using this template to create a navigation template can be relatively convenient and fast to summarize related articles (here refers to category:Navbox templates).
This has many variable parameters, which can be used with {{Navbox subgroup}}, {{Navbox with columns}}, {{Navbox with collapsible groups}}.
name
.[mw-uncollapsed, mw-collapsed]
background:gray
The source code containing common parameters can be copied and used to quickly create a navbox template |
---|
Please delete the unused parameters and do not keep them. {{Navbox |name = {{subst:PAGENAME}} |title = |state = |titlestyle= background: |groupstyle= background: |evenstyle = background: |above = |group1= |list1 = [[]] • <!-- -->[[]] |group2= |list2 = [[]] • <!-- -->[[]] |group3= |list3 = [[]] • <!-- -->[[]] |group4= |list4 = [[]] • <!-- -->[[]] |group5= |list5 = [[]] • <!-- -->[[]] |group6= |list6 = [[]] • <!-- -->[[]] |below = }} |
Most of the other parameters of Navbox are not commonly used, so the commonly used parameters are encapsulated into two simplified templates: {{Daikazoku}} ({{Daikazoku template}}) and {{Daikazoku content line}} ({{Links}}).
For the effects of some commonly used parameters, please refer to #Table layout, #Examples; further details and complex constraints are explained in the #Parameter description section below.
Below is a complete list of parameters used in {{Navbox}}. In most cases, as long as the parameters name
, title
and list1
are sufficient, although subgroup You don’t even need to set those parameters.
{{Navbox}} shares many common parameters with its sister templates {{Navbox with columns}} and {{Navbox with collapsible groups}} to improve consistency and ease of use. A parameter marked with "†" applies to all three master templates.
{{subst:PAGENAME}}
as the value of this parameter, which is also a quick way. This parameter is required.[mw-uncollapsed, mw-collapsed, plain, off]
mw-collapsed
, the navigation frame will always be displayed in a collapsed state at the beginning.plain
, the navigation box will always be expanded without the "hidden" link on the right side, and the title will remain centered (by using padding to offset "View • Talk • Edit" link).off
, the navigation box will always be expanded without the "hidden" link on the right, but no padding will be used to keep the title centered. This is just for advanced usage; the "plain" option should satisfy most applications that need to hide the "show"/"hide" buttons.mw-collapsed
, plain
or off
(like "mw-uncollapsed"), the navigation The box will always appear in an expanded state at the beginning, but with a "hide" button.|state = {{{state<includeonly>|Initial state you want</includeonly>}}}
<includeonly>|
will cause the template to be expanded when viewing the template page itself.Navbar
. If it is set to plain
, the View • Talk • Edit link on the left side of the title bar will not be displayed, and the padding will be automatically applied to keep the title centered. Set to off
to remove the View •Talk • Edit link, but no padding will be applied (this is just for advanced usage; the "plain" option should satisfy most unwanted The application of the navigation bar.) It is strongly recommended that users do not hide the navigation bar, in order to make it easier for users to edit the template, and to have a standard style throughout each page.[subgroup, child, none]
{{brClear}}
to ensure correct centering. This parameter is not technically necessary, but it is quite meaningless to use {{Navbox}} without a title.<div> </div>
, the text can be entered on different lines. At least one "list" parameter is required; each additional "list" is displayed in a separate table row. Each listn may have a corresponding groupn parameter in front of it, if provided (see below).image = [[File:Example.jpg|100px]]
(see Help:image)imageleft = [[File:Example.jpg|100px]]
style = background:#nnnnnn;
style = width:N [em/%/px or width:auto];
style = float:[left/right/none];
style = clear:[right/left/both/none];
titlestyle = background:#nnnnnn;
titlestyle = background:name;
groupstyle = background:#nnnnnn;
groupstyle = text-align:[left/center/right];
groupstyle = vertical-align:[top/middle/bottom];
liststyle
. The default performance is to add striped colors (white and gray) to odd/even rows respectively to improve readability. Except in very special circumstances, these settings should not be changed.[swap, even, odd]
swap
to flip the parity of each list; it can be used to solve the problem of misalignment of the parity pattern after inserting the sub-navigation box.even
or odd
to make all the list styles be the style of even-numbered or odd-numbered rows.abovestyle = background:#nnnnnn;
abovestyle = text-align:``left/center/right;
The style settings listed here are those that are changed most often by editors who use the navigation box. Other more complex style settings are excluded from this list to keep it simple. Most styles are set in MediaWiki:Common.css.
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-numbered lists have the color bodystyle, and the default value is #fdfdfd (white with a little gray). A list has a text-align:left;
setting, if it has a group; otherwise, it has a text-align:center;
setting. Since only "bodystyle" has a vertical-align attribute, all other styles inherit its vertical-align:middle;
setting.
The table generated by {{Navbox}} without the image, above and below parameters (the gray list background color is added just for demonstration):
|
The table generated by {{Navbox}} with the image, above and below parameters (the gray list background color is added just for demonstration):
|
The table generated by {{Navbox}} with image, imageleft, lists, and without groups, above and below (the gray list background color is added just for demonstration):
|
-{}-{{Navbox |name = Navbox/doc |title = [[Oarai Women’s Academy]] Student Club Members |group1= Volleyball Club |list1 = [[Isobe Noriko]] • <!-- -->[[Shinobu Kawanishi]] • <!-- -->[[Sasaki Asuka]] • <!-- -->[[Kondo Taeko]] |group2= Automotive Club |list2 = [[Nakajima Riro]] • <!-- -->[[Suzuki (Girls und Panzer)|Suzuki]] • <!-- -->[[Hoshino (Girls und Panzer)|Hoshino]] • <!-- -->[[Tsuchiya (Girls und Panzer)|Tsuchiya]] |group3= Broadcasting Club |list3 = [[Taiga Oo]] }}
|
-{}-{{Navbox |name = Navbox/doc |title = [[Oarai Women’s Academy]] Student Club Members |image = [[File:GUP_Ooarai.svg|80px]] |group1= Volleyball Club |list1 = [[Isobe Noriko]] • <!-- -->[[Shinobu Kawanishi]] • <!-- -->[[Sasaki Asuka]] • <!-- -->[[Kondo Taeko]] |group2= Automotive Club |list2 = [[Nakajima Riro]] • <!-- -->[[Suzuki (Girls und Panzer)|Suzuki]] • <!-- -->[[Hoshino (Girls und Panzer)|Hoshino]] • <!-- -->[[Tsuchiya (Girls und Panzer)|Tsuchiya]] |group3= Broadcasting Club |list3 = [[Taiga Oo]] }}
|
-{}-{{Navbox |name = Navbox/doc |title = [[Oarai Women’s Academy]] Student Club Members |image = [[File:GUP_Ooarai.svg|80px]] |imageleft = [[File:GUP Logo Alpha0.svg|80px]] |list1 = [[Isobe Noriko]] • <!-- -->[[Shinobu Kawanishi]] • <!-- -->[[Sasaki Asuka]] • <!-- -->[[Kondo Taeko]] |list2 = [[Nakajima Riro]] • <!-- -->[[Suzuki (Girls und Panzer)|Suzuki]] • <!-- -->[[Hoshino (Girls und Panzer)|Hoshino]] • <!-- -->[[Tsuchiya (Girls und Panzer)|Tsuchiya]] |list3 = [[Taiga Oo]] }}
|
-{}-{{Navbox |name = Navbox/doc |title = [[Oarai Women’s Academy]] Student Club Members |image = [[File:GUP_Ooarai.svg|80px]] |above = (Only list members who have joined the clubs) |group1= Volleyball Club |list1 = [[Isobe Noriko]] • <!-- -->[[Shinobu Kawanishi]] • <!-- -->[[Sasaki Asuka]] • <!-- -->[[Kondo Taeko]] |group2= Automotive Club |list2 = [[Nakajima Riro]] • <!-- -->[[Suzuki (Girls und Panzer)|Suzuki]] • <!-- -->[[Hoshino (Girls und Panzer)|Hoshino]] • <!-- -->[[Tsuchiya (Girls und Panzer)|Tsuchiya]] |group3= Broadcasting Club |list3 = [[Taiga Oo]] |below = "[[Girls und Panzer]]" official website: https://girls-und-panzer.jp/ }}
|
To place the subgroup navbox in the parent navbox, using {{Navbox subgroup}} is recommended. But the same effect can be achieved by adding |border = subgroup/child
in {{Navbox}} or setting the first parameter (unnamed) to subgroup/child
. The subgroup navbox does not require the name
parameter.
{{Navbox subgroup |group1= |list1 = |group2= |list2 = ... }}
{{Navbox|border=subgroup |group1= |list1 = |group2= |list2 = ... }}
{{Navbox|subgroup |group1= |list1 = |group2= |list2 = ... }}
It looks like this:
{{{group1}}} | {{{list1}}} |
{{{group2}}} | {{{list2}}} |
…… |
Then put it into a list (you can increase the indentation to indicate the hierarchical relationship). E.g:
-{}-{{Navbox |name = Navbox/doc |title = Example of sub-navbox |group1= Group 1 |list1 = List 1 |group2= group 2 |list2 = {{Navbox subgroup |evenodd = swap |group1= Group 2.1 |list1 = List 1 |group2= Group 2.2 |list2 = List 2 |group3= Group 2.3 |list3 = List 3 }} |group3= Group 3 |list3 = List 3 }}
|
It can be noticed that a evenodd
parameter is used above, which is used to adjust the distribution of striped color bands in some sub-groups to ensure that the color bands are arranged crosswise. If you want to remove all striped color bands, you can set liststyle = background:transparent
in each Navbox.
From the designer's perspective, border = subgroup
and border = child
are suitable for different situations. When set to subgroup, the group is narrower, and it is suitable for the group of the sub-navbox to be arranged side by side with the group of the parent navbox. For example, in the above example, group 2.X and group 2 are in a row; while the group of child keeps the default width, which is suitable for the child The group of the navigation box serves as the first-level group, such as #Multiple expand/collapse below. Template:Nonsense
The appearance of border = none
is similar to that of subgroup and child, but it is suitable for "not used in navigation box", such as putting {{Navbox|none…}}
is embedded in some other template (not this template and its sister templates). On the contrary, do not embed subgroups and children into templates other than Navbox and sister templates, which will cause potential errors.
When there is too much content in the navbox template, you can consider using multiple expand/collapse. You can use {{Navbox with collapsible groups}}, which is more convenient and intuitive. It can also be achieved using only Navbox:
{{Navbox |name = Navbox/doc |title = …… |list1 = {{Navbox|child |navbar = plain |title = …… ... }} |list2 = {{Navbox|child |navbar = plain |title = …… ... }} |list3 = {{Navbox|child |navbar = plain |title = …… ... }} }}
|
This navbox template is specially designed to work with two other sister templates: {{Navbox with columns}} and {{Navbox with collapsible groups}}. All three templates share common parameters to improve consistency and ease of use (such parameters are marked with † in the complete parameter list above). Most importantly, all three templates can be used as child templates of one another (by using the border = child
parameter, or specifying the first parameter (unnamed) as child
. For example, use {{Navbox|child…}}
, {{Navbox with columns|child…}}
or {{Navbox with collapsible groups|child…}}
).
groupstyle = width:10em;
liststyle = width:auto;
style / bodystyle
, then this feature will not work.style = width:22em;float:right;margin-left:1em;margin-right:0
|