Template:Navbox subgroup

From mediawiki.org
Jump to navigation Jump to search
Template documentation

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[edit]

{{Navbox subgroup
| groupstyle = 
| liststyle  = 

| group1 = 
| list1  = 
| group2 = 
| list2  = 
| group20 = 
| list20  = 


This template employs all parameters of startNavboxend. Please see the documentation there for more complete descriptions. In fact, the only differences between this template and startNavboxend 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 startNavboxend.

Only the most common parameters are listed below.


(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.
(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).


Specifies CSS styles to apply to the template body. Examples:
CSS styles to apply to the groupn cells. This option overrides any styles that are applied to the entire table. Examples:
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)
CSS styles to apply to all lists. Overridden by the oddstyle and evenstyle parameters (if specified) below.
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 to even or odd sets all rows to have that striping color. Setting to off disables automatic row striping. NOTE: Due to system limitations, do not use a semi-colon to close this command.

Setting the width of groups[edit]

If multiple startNavbox subgroupend templates are used inside of a parent startNavboxend, 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 startNavbox subgroupend to adjust the widths:

groupstyle = width:10em;
liststyle = width:auto;
  • NOTE: For the groupstyle widths to work, you must set the liststyle 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.


The following is an example of Navbox subgroup used within a Navbox template.

| name = Social tools
| title = {{ll|Social tools|Social tools}}
| bodyclass = hlist

| group1 = {{ll|Extension:SocialProfile|nsp=0}}
| list1 = 
* {{ll|Extension:SocialProfile|Overview}}
* {{ll|Extension:SocialProfile/For developers|Developer info}}
* {{ll|Extension:SocialProfile/Screenshots|Screenshots}}
* {{ll|Social tools#History|History}}
|group2 = Other social extensions
|list2 =
{{Navbox subgroup
| group1 = Dependent on SocialProfile
| list1 = 
* {{ll|Extension:BlogPage|nsp=0}}
* {{ll|Extension:Challenge|nsp=0}}
* {{ll|Extension:FanBoxes|nsp=0}}
* {{ll|Extension:MiniInvite|nsp=0}}
* {{ll|Extension:PictureGame|nsp=0}}
* {{ll|Extension:PollNY|nsp=0}}
* {{ll|Extension:QuizGame|nsp=0}}
* {{ll|Extension:RandomGameUnit|nsp=0}}
* {{ll|Extension:SiteMetrics|nsp=0}}
* {{ll|Extension:SportsTeams|nsp=0}}
* {{ll|Extension:UserStatus|nsp=0}}
* {{ll|Extension:UserWelcome|nsp=0}}

| group2 = Other related extensions<br />
<small>(which do not depend on SocialProfile)</small>
| list2 = 
* {{ll|Extension:AJAXPoll|nsp=0}}
* {{ll|Extension:Comments|nsp=0}}
* {{ll|Extension:ImageRating|nsp=0}}
* {{ll|Extension:LinkFilter|nsp=0}}
* {{ll|Extension:MediaWikiChat|nsp=0}}
* {{ll|Extension:NewSignupPage|nsp=0}}
* {{ll|Extension:Video|nsp=0}}
* {{ll|Extension:VoteNY|nsp=0}}
* {{ll|Extension:WikiForum|nsp=0}}
* {{ll|Extension:WikiTextLoggedInOut|nsp=0}}

See also[edit]