Template:Navbox subgroup/doc: Difference between revisions
m (1 revision: navboxes) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
<!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | ||
This template is designed to be used with {{tl|Navbox}} or other [[Wikipedia:Navigation templates|navigation template]]s that allow creating lists of links with groups headers or titles. This template allows the creation of subgroups that can be assigned to a list item within {{tl|Navbox}}. A subgroup may contain up to 20 list items. | This template is designed to be used with {{tl|Navbox}} or other [[Wikipedia:wikipedia:Navigation templates|navigation template]]s that allow creating lists of links with groups headers or titles. This template allows the creation of subgroups that can be assigned to a list item within {{tl|Navbox}}. A subgroup may contain up to 20 list items. | ||
== Blank template == | == Blank template == | ||
Line 24: | Line 23: | ||
This template employs all parameters of {{t1|Navbox}}. Please see the documentation there for more complete descriptions. In fact, the only differences between this template and {{t1|Navbox}} are as follows: | This template employs all parameters of {{t1|Navbox}}. Please see the documentation there for more complete descriptions. In fact, the only differences between this template and {{t1|Navbox}} are as follows: | ||
*The border parameter defaults to "child" | *The border parameter defaults to "child" | ||
*The group padding defaults to 0.75em on the left/right, and can only be changed with the <code>grouppadding</code> parameter. This is done to prevent the [[Internet Explorer box model bug]] from affecting the width of groups. | *The group padding defaults to 0.75em on the left/right, and can only be changed with the <code>grouppadding</code> parameter. This is done to prevent the [[wikipedia:Internet Explorer box model bug|Internet Explorer box model bug]] from affecting the width of groups. | ||
Everything else is ''exactly'' the same as {{t1|Navbox}}. | Everything else is ''exactly'' the same as {{t1|Navbox}}. | ||
Line 38: | Line 37: | ||
=== Styles === | === Styles === | ||
:; ''bodystyle'' | :; ''bodystyle'' | ||
:: Specifies [[Cascading Style Sheets|CSS]] styles to apply to the template body. Examples: | :: Specifies [[wikipedia:Cascading Style Sheets|CSS]] styles to apply to the template body. Examples: | ||
::: <code>background:#''nnnnnn'';</code> | ::: <code>background:#''nnnnnn'';</code> | ||
::: <code>text-align:[''right/center/left/justified''];</code> | ::: <code>text-align:[''right/center/left/justified''];</code> | ||
Line 87: | Line 86: | ||
| group1 = National Parks | | group1 = National Parks | ||
| list1 = | | list1 = | ||
*[[Black Canyon of the Gunnison National Park|Black Canyon of the Gunnison]] | *[[wikipedia:Black Canyon of the Gunnison National Park|Black Canyon of the Gunnison]] | ||
*[[Great Sand Dunes National Park and Preserve|Great Sand Dunes]] | *[[wikipedia:Great Sand Dunes National Park and Preserve|Great Sand Dunes]] | ||
*[[Mesa Verde National Park|Mesa Verde]] | *[[wikipedia:Mesa Verde National Park|Mesa Verde]] | ||
*[[Rocky Mountain National Park|Rocky Mountain]] | *[[wikipedia:Rocky Mountain National Park|Rocky Mountain]] | ||
| group2 = National Monuments | | group2 = National Monuments | ||
| list2 = | | list2 = | ||
*[[Colorado National Monument|Colorado]] | *[[wikipedia:Colorado National Monument|Colorado]] | ||
*[[Florissant Fossil Beds National Monument|Florissant Fossil Beds]] | *[[wikipedia:Florissant Fossil Beds National Monument|Florissant Fossil Beds]] | ||
*[[Hovenweep National Monument|Hovenweep]] | *[[wikipedia:Hovenweep National Monument|Hovenweep]] | ||
*[[Yucca House National Monument|Yucca House]] | *[[wikipedia:Yucca House National Monument|Yucca House]] | ||
| group3 = National Historic Sites | | group3 = National Historic Sites | ||
| list3 = | | list3 = | ||
*[[Bent's Old Fort National Historic Site|Bent's Old Fort]] | *[[wikipedia:Bent's Old Fort National Historic Site|Bent's Old Fort]] | ||
*[[Sand Creek Massacre National Historic Site|Sand Creek Massacre]] | *[[wikipedia:Sand Creek Massacre National Historic Site|Sand Creek Massacre]] | ||
| group4 = National Recreation Area | | group4 = National Recreation Area | ||
| list4 = | | list4 = | ||
*[[Curecanti National Recreation Area|Curecanti]] | *[[wikipedia:Curecanti National Recreation Area|Curecanti]] | ||
}} | }} | ||
| group2 = National Forests | | group2 = National Forests | ||
| list2 = | | list2 = | ||
*[[Arapaho National Forest|Arapaho]] | *[[wikipedia:Arapaho National Forest|Arapaho]] | ||
*[[Grand Mesa National Forest|Grand Mesa]] | *[[wikipedia:Grand Mesa National Forest|Grand Mesa]] | ||
*[[Gunnison National Forest|Gunnison]] | *[[wikipedia:Gunnison National Forest|Gunnison]] | ||
*[[Pike National Forest|Pike]] | *[[wikipedia:Pike National Forest|Pike]] | ||
*[[Rio Grande National Forest|Rio Grande]] | *[[wikipedia:Rio Grande National Forest|Rio Grande]] | ||
*[[Roosevelt National Forest|Roosevelt]] | *[[wikipedia:Roosevelt National Forest|Roosevelt]] | ||
*[[Medicine Bow - Routt National Forest|Medicine Bow - Routt]] | *[[wikipedia:Medicine Bow - Routt National Forest|Medicine Bow - Routt]] | ||
*[[San Isabel National Forest|San Isabel]] | *[[wikipedia:San Isabel National Forest|San Isabel]] | ||
*[[San Juan National Forest|San Juan]] | *[[wikipedia:San Juan National Forest|San Juan]] | ||
*[[Uncompahgre National Forest|Uncompahgre]] | *[[wikipedia:Uncompahgre National Forest|Uncompahgre]] | ||
*[[White River National Forest|White River]] | *[[wikipedia:White River National Forest|White River]] | ||
}} | }} | ||
Line 130: | Line 129: | ||
| group1 = National Parks | | group1 = National Parks | ||
| list1 = | | list1 = | ||
*[[Black Canyon of the Gunnison National Park|Black Canyon of the Gunnison]] | *[[wikipedia:Black Canyon of the Gunnison National Park|Black Canyon of the Gunnison]] | ||
*[[Great Sand Dunes National Park and Preserve|Great Sand Dunes]] | *[[wikipedia:Great Sand Dunes National Park and Preserve|Great Sand Dunes]] | ||
*[[Mesa Verde National Park|Mesa Verde]] | *[[wikipedia:Mesa Verde National Park|Mesa Verde]] | ||
*[[Rocky Mountain National Park|Rocky Mountain]] | *[[wikipedia:Rocky Mountain National Park|Rocky Mountain]] | ||
| group2 = National Monuments | | group2 = National Monuments | ||
| list2 = | | list2 = | ||
*[[Colorado National Monument|Colorado]] | *[[wikipedia:Colorado National Monument|Colorado]] | ||
*[[Florissant Fossil Beds National Monument|Florissant Fossil Beds]] | *[[wikipedia:Florissant Fossil Beds National Monument|Florissant Fossil Beds]] | ||
*[[Hovenweep National Monument|Hovenweep]] | *[[wikipedia:Hovenweep National Monument|Hovenweep]] | ||
*[[Yucca House National Monument|Yucca House]] | *[[wikipedia:Yucca House National Monument|Yucca House]] | ||
| group3 = National Historic Sites | | group3 = National Historic Sites | ||
| list3 = | | list3 = | ||
*[[Bent's Old Fort National Historic Site|Bent's Old Fort]] | *[[wikipedia:Bent's Old Fort National Historic Site|Bent's Old Fort]] | ||
*[[Sand Creek Massacre National Historic Site|Sand Creek Massacre]] | *[[wikipedia:Sand Creek Massacre National Historic Site|Sand Creek Massacre]] | ||
| group4 = National Recreation Area | | group4 = National Recreation Area | ||
| list4 = | | list4 = | ||
*[[Curecanti National Recreation Area|Curecanti]] | *[[wikipedia:Curecanti National Recreation Area|Curecanti]] | ||
}} | }} | ||
| group2 = National Forests | | group2 = National Forests | ||
| list2 = | | list2 = | ||
*[[Arapaho National Forest|Arapaho]] | *[[wikipedia:Arapaho National Forest|Arapaho]] | ||
*[[Grand Mesa National Forest|Grand Mesa]] | *[[wikipedia:Grand Mesa National Forest|Grand Mesa]] | ||
*[[Gunnison National Forest|Gunnison]] | *[[wikipedia:Gunnison National Forest|Gunnison]] | ||
*[[Pike National Forest|Pike]] | *[[wikipedia:Pike National Forest|Pike]] | ||
*[[Rio Grande National Forest|Rio Grande]] | *[[wikipedia:Rio Grande National Forest|Rio Grande]] | ||
*[[Roosevelt National Forest|Roosevelt]] | *[[wikipedia:Roosevelt National Forest|Roosevelt]] | ||
*[[Medicine Bow - Routt National Forest|Medicine Bow - Routt]] | *[[wikipedia:Medicine Bow - Routt National Forest|Medicine Bow - Routt]] | ||
*[[San Isabel National Forest|San Isabel]] | *[[wikipedia:San Isabel National Forest|San Isabel]] | ||
*[[San Juan National Forest|San Juan]] | *[[wikipedia:San Juan National Forest|San Juan]] | ||
*[[Uncompahgre National Forest|Uncompahgre]] | *[[wikipedia:Uncompahgre National Forest|Uncompahgre]] | ||
*[[White River National Forest|White River]] | *[[wikipedia:White River National Forest|White River]] | ||
}} | }} | ||
</pre> | </pre> | ||
Line 168: | Line 167: | ||
* {{t1|Navbox with columns}} – Allows columns instead of groups/lists | * {{t1|Navbox with columns}} – Allows columns instead of groups/lists | ||
* {{t1|Navbox with collapsible groups}} – Another variation. | * {{t1|Navbox with collapsible groups}} – Another variation. | ||
<includeonly> | <includeonly> | ||
<!--Categories--> | <!--Categories--> | ||
[[Category:Navigational boxes| ]] | [[Category:Navigational boxes| ]] | ||
</includeonly> | |||
Latest revision as of 21:05, 1 March 2013
![]() |
This is a documentation subpage for Template:Navbox subgroup. It contains usage information, categories and other content that is not part of the original template page. |
This template is designed to be used with {{Navbox}} or other navigation templates that allow creating lists of links with groups headers or titles. This template allows the creation of subgroups that can be assigned to a list item within {{Navbox}}. A subgroup may contain up to 20 list items.
Blank template
{{Navbox subgroup | groupstyle = | liststyle = | group1 = | list1 = | group2 = | list2 = ... | group20 = | list20 = }}
Parameters
This template employs all parameters of {{Navbox}}. Please see the documentation there for more complete descriptions. In fact, the only differences between this template and {{Navbox}} are as follows:
- The border parameter defaults to "child"
- The group padding defaults to 0.75em on the left/right, and can only be changed with the
grouppadding
parameter. This is done to prevent the Internet Explorer box model bug from affecting the width of groups.
Everything else is exactly the same as {{Navbox}}.
Only the most common parameters are listed below.
Cells
- listn
- (i.e. list1, list2, ... list20) The body of the template, usually a list of links. Format is inline. At least one list parameter is required; each additional list is displayed in a separate row of the table. Each listn may be preceded by a corresponding groupn parameter, if provided (see below). The background color of the list items (and the entire table) defaults to
transparent
, therefore it displays the same background color used in the parent navigation box.
- groupn
- (i.e. group1, group2, ..., group20) If specified, text appears in a header cell displayed to the left of listn. If omitted, listn uses the full width of the table. The background color defaults to
#e6e6ff
, but can be changed via the groupstyle parameter (see below).
Styles
- bodystyle
- Specifies CSS styles to apply to the template body. Examples:
background:#nnnnnn;
text-align:[right/center/left/justified];
- groupstyle
- CSS styles to apply to the groupn cells. This option overrides any styles that are applied to the entire table. Examples:
background:#nnnnnn;
text-align:[left/center/right];
vertical-align:[top/middle/bottom];
white-space:nowrap;
- grouppadding
- CSS style to specify group padding. Should usually be specified using em units. It is recommended to leave this parameter alone and use the default padding. Examples:
grouppadding = 0em 1em;
(1em on left/right, 0em on top/bottom)grouppadding = 0em 0.5em 0em 1em;
(0em top, 0.5em right, 0em bottom, 1em left)
- liststyle
- CSS styles to apply to all lists. Overridden by the oddstyle and evenstyle parameters (if specified) below.
- oddstyle
- evenstyle
- CSS styles to apply to the odd-numbered list items (list1, list3, etc) or even-numbered list items (list2, list4, etc), respectively. Typically used to set background color (
background:#nnnnnn;
) in order to achieve an alternating background color between odd and even-numbered lists.
- evenodd
[swap, even, odd, off]
- 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 toeven
orodd
sets all rows to have that striping color. Setting tooff
disables automatic row striping. NOTE: Due to system limitations, do not use a semi-colon to close this command.
- evenodd
Setting the width of groups
If multiple {{Navbox subgroup}} templates are used inside of a parent {{Navbox}}, it generally looks better if the width of the groups matches up. In order to do this, one must set the groupwidth
parameter:
groupwidth = 10em
An alternative way is to set the groupstyle
parameters to contain the desired width, and the liststyle
parameters to have width:auto (due to HTML/CSS reasons). For example, place the following code in each {{Navbox subgroup}} to adjust the widths:
groupstyle = width:10em;
liststyle = width:auto;
- NOTE: For the
groupstyle
widths to work, you must set theliststyle
width to "auto".
If you also use the image
or imageleft
parameters, then you will most likely also need to set their width manually using the imagestyle
and imageleftstyle
parameters.
Example
The following is an example of Navbox subgroup used within a Navbox template.
{{Navbox | state = uncollapsed | name = Protected Areas of Colorado | title = Protected Areas of Colorado | listclass = hlist | group1 = National Park Service | list1 = {{Navbox subgroup | group1 = National Parks | list1 = *[[wikipedia:Black Canyon of the Gunnison National Park|Black Canyon of the Gunnison]] *[[wikipedia:Great Sand Dunes National Park and Preserve|Great Sand Dunes]] *[[wikipedia:Mesa Verde National Park|Mesa Verde]] *[[wikipedia:Rocky Mountain National Park|Rocky Mountain]] | group2 = National Monuments | list2 = *[[wikipedia:Colorado National Monument|Colorado]] *[[wikipedia:Florissant Fossil Beds National Monument|Florissant Fossil Beds]] *[[wikipedia:Hovenweep National Monument|Hovenweep]] *[[wikipedia:Yucca House National Monument|Yucca House]] | group3 = National Historic Sites | list3 = *[[wikipedia:Bent's Old Fort National Historic Site|Bent's Old Fort]] *[[wikipedia:Sand Creek Massacre National Historic Site|Sand Creek Massacre]] | group4 = National Recreation Area | list4 = *[[wikipedia:Curecanti National Recreation Area|Curecanti]] }} | group2 = National Forests | list2 = *[[wikipedia:Arapaho National Forest|Arapaho]] *[[wikipedia:Grand Mesa National Forest|Grand Mesa]] *[[wikipedia:Gunnison National Forest|Gunnison]] *[[wikipedia:Pike National Forest|Pike]] *[[wikipedia:Rio Grande National Forest|Rio Grande]] *[[wikipedia:Roosevelt National Forest|Roosevelt]] *[[wikipedia:Medicine Bow - Routt National Forest|Medicine Bow - Routt]] *[[wikipedia:San Isabel National Forest|San Isabel]] *[[wikipedia:San Juan National Forest|San Juan]] *[[wikipedia:Uncompahgre National Forest|Uncompahgre]] *[[wikipedia:White River National Forest|White River]] }}
See also
- {{Navbox}} – Basic navbox
- {{Navbox with columns}} – Allows columns instead of groups/lists
- {{Navbox with collapsible groups}} – Another variation.