Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Template:Navbox with collapsible groups/doc

From Wikipedia, the free encyclopedia
<Template:Navbox with collapsible groups
iconThis is adocumentationsubpage forTemplate:Navbox with collapsible groups.
It may contain usage information,categories and other content that is not part of the original template page.
WarningThis template is used onapproximately 141,000 pages.
To avoid major disruption and server load, any changes should be tested in the template's/sandbox or/testcases subpages, or in your ownuser subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on thetalk page before implementing them.
This template usesLua:
Navbox suite
Collapsible templates
Help:Collapsing
Guideline:Hidden content
Article namespace
Infoboxes
Navigation templates
Talk namespace

This template produces anavigation template that has groups of relevant articles on a certain topic. All groups are hidden by default. However, with a parameter call, an individual group can be shown that has the other articles in the same group.

Usage

[edit]

Please remove the parameters that are left blank. The template currently supports up to 20 groups/lists but more can be added if needed. You should use a minimum of two groups/lists; otherwise, use{{Navbox}} instead.

{{Navbox with collapsible groups| name={{subst:PAGENAME}}| title=| listclass= hlist| state={{{state|}}}| selected={{{selected|{{{1|}}}}}}| above=| image=| abbr1=| group1=| list1=| abbr2=| group2=| list2=<!--[etc, to:]-->| abbr20=| group20=| list20=}}

Parameters

[edit]

This template shares many common parameters with its sister templates{{Navbox}} and{{Navbox with columns}}. The common parameters are marked with a cross. Please refer to the documentation of{{Navbox}} for more in depth descriptions and examples of those parameters.

Setup parameters

[edit]
name
The name of the template. The name of this template, for example, is "Navbox with collapsible groups".
state[uncollapsed, collapsed, plain, off]
The initial state of the show/hide feature for the main title. See{{Navbox}} for more information. Does not affect display or hiding of group items, seestaten, below.
navbar
Possible values areplain,off, and the default value of blank. See{{Navbox}} for more information.
border
Possible values arechild,none, and the default value of blank. Set tochild if you wish to use the navbox inside of another navbox; with this option, the child navbox is borderless and fits snuggly inside of its parent navbox. The parent navbox may be the list area of{{Navbox}}, the columns of a{{Navbox with columns}}, or a list area of{{Navbox with collapsible groups}}. See{{Navbox}} for more information and examples.

Basic data parameters

[edit]
title
The title of the template, displayed centered in the titlebar at the top of the template.
above
Text or other elements to appear above groups/lists.
image
Image to the right of all of the groups/lists.
imageleft
Image to the left of all of the groups/lists.
below
Text or other elements to appear below the groups/lists.

Group/list parameters

[edit]
groupn
The title of each section.
listn
The content/wikilinks that will be shown in the group.Use dots or bullets as separators (see theSee also section). A{{Navbox}} or{{Navbox with columns}} can optionally be used here with itsborder = child parameter set. If this is done, leave the corresponding groupn blank, as the child navbox will already provide the collapsible feature.
abbrn
This is the abbreviation of the group. Seeselected parameter immediately below to see how to use this parameter. This parameter is optional, but recommended.
selected
If the value ofselected equals the value ofabbrn, then listn is uncollapsed and all other lists are collapsed. Ifselected is left blank, or if it does not match anyabbrn, then all groups are collapsed. Usually this parameter should be set to{{{1|}}}. Since this template is a base template for others, there has to be a way to pass the group parameter from the article, to the secondary template to this one.
The collapsed/uncollapsed options can be listed on the template's page by using the{{Collapsible sections option}} template in the <noinclude> part of the page.
staten[uncollapsed, collapsed, plain, off]
The initial collapsible state of listn. Set to collapsed by default. Overridden to uncollapsed ifselected equalsabbrn.
imagen
An image to appear in the listn content area on the right side.
imageleftn
An image to appear in the listn content area on the left side.

Style parameters

[edit]
bodystyle
CSS style/s to apply to the entire template
titlestyle
CSS style/s to apply to titlebar; usuallybackground:color. The color of wikilink text must be manually changed using span tags. For example usetitle = [[Scouting|<span>Scouting</span>]] to change the color of the link to ivory. The [show]/[hide] button and the vde link button use the color set in the titlestyle parameter. Here is an example of setting the titlestyle:
titlestyle = background:darkgreen;color:ivory;
abovestyle
belowstyle
CSS style/s to apply to theabove andbelow parameters, respectively.
basestyle
CSS style/s to apply to thetitle,above,below, andgroupn parameters, all at the same time.
imagestyle
CSS style/s to apply to theimage parameter. Does not get applied to the imagen parameters.
imageleftstyle
CSS style/s to apply to theimageleft parameter. Does not get applied to the imageleftn parameters.
groupstyle
CSS style/s to apply to all group heading parameters. Visitthis website to get a lighter color similar to the title background color. Example:
groupstyle = background:lightgreen;
groupnstyle
CSS style/s to apply to a specific group heading; overrides any CSS styles set ingroupstyle.
liststyle
CSS style/s to apply to all list content parameters.
listnstyle
CSS style/s to apply to specific list content parameters; overrides any CSS styles set inliststyle.
listpadding
Padding to have in each list cell; defaults to 0.25em on the left/right and 0em on the top/bottom.

Microformat parameters

[edit]
bodyclass
This parameter is inserted into the "class" attribute for the infobox as a whole.
titleclass
This parameter is inserted into the "class" attribute for the infobox's title caption.
SeeWikipedia:WikiProject Microformats for more information on adding microformat information to Wikipedia, andmicroformat for more information on microformats in general.

Examples

[edit]

Basic example

[edit]
{{Navbox with collapsible groups|name= University of Michigan|state= uncollapsed|title=[[University of Michigan|<spanstyle="color:#FFD700;">The University of Michigan, Ann Arbor</span>]]|titlestyle= background:#00008B;color:#FFD700;|listclass= hlist|groupstyle= background:#FFD700;color:#00008B;|image=|selected={{{1|}}}|group1=[[University of Michigan#Academic profile|<spanstyle="color:#00008B;">Academics</span>]]|abbr1= academics|list1=*[[University of Michigan College of Engineering|College of Engineering]]*[[University of Michigan College of Literature, Science, and the Arts|College of Literature, Science and the Arts]]*[[Gerald R. Ford School of Public Policy]]*[[University of Michigan Law School|Law School]]*[[University of Michigan Health System|Medical School]]*[[Ross School of Business]]*[[University of Michigan School of Education|School of Education]]*[[University of Michigan School of Information|School of Information]]*[[University of Michigan School of Music, Theatre & Dance|School of Music, Theatre & Dance]]*[[University of Michigan School of Natural Resources and Environment|School of Natural Resources and Environment]]*[[University of Michigan School of Public Health|School of Public Health]]*[[Taubman College of Architecture and Urban Planning]]|group2=[[Michigan Wolverines|<spanstyle="color:#00008B;">Athletics</span>]]|abbr2= athletics|state2= uncollapsed|list2=*[[Michigan Stadium]]*[[Crisler Arena]]*[[Yost Ice Arena]]*[[Michigan Wolverines]]*[[Michigan Wolverines football|Football]]*[[Michigan – Ohio State football rivalry|UM-OSU Rivalry]]*[[Little Brown Jug (American football)|Little Brown Jug]]*[[Paul Bunyan Trophy]]*[[Cold War (ice hockey)|Cold War]]|group3= Campus|abbr3= campus|list3=*[[Angell Hall Observatory]]*[[Burton Memorial Tower|Burton Tower]]*[[The Diag]]*[[David M. Dennison Building|Dennison Building]]*[[Gerald R. Ford Presidential Library]]*[[Hill Auditorium]]*[[Lurie Tower]]*[[Matthaei Botanical Gardens]]*[[Michigan Union]]*[[Museums at the University of Michigan|Museums]]*[[Nichols Arboretum]]*[[University of Michigan Health System|UM Health System]]*[[University of Michigan Library|University Library]]}}
Campus

Nesting navboxes

[edit]

To nest a navbox inside a Navbox with collapsible groups, set thelistn parameter tochild orsubgroup. Elements of the child navbox can be specified by prependingchildn_,subgroupn_, or justn_ to the parameter names (e.g.1_list1). Child navboxes can be nested by adding an additional prefix (e.g.1_1_list1). The basic code for doing this is as follows (which adds a subgroup for the first group/list area):

{{Navbox with collapsible groups| name={{subst:PAGENAME}}| title= Title| group1= Group Title| list1= child| 1_title= [optional]| 1_group1= [optional]| 1_list1= child| 1_1_title= [optional]| 1_1_group1= [optional]| 1_1_list1=     ...list contents...  ......}}
Navbox with collapsible groups with nested Navboxes
Group 1 Title
Group 1 Child Navbox Group 1
Group 1 Child Navbox's Child Navbox Group 1
Group 1 Child Navbox's Child Navbox List 1
Group 1 Child Navbox's Child Navbox List 2
Group 1 Child Navbox Group 2
Group 1 Child Navbox List 2

{{Navbox with collapsible groups}} or{{Navbox with columns}} can be nested by setting then_type parameter to "with collapsible groups" or "with columns".

Relationship with other Navbox templates

[edit]

This navbox template works in conjunction with two other templates:{{Navbox}} and{{Navbox with columns}}. All three of these templates share common parameters for consistency and ease of use (such parameters are marked with an asterisk (*) in theparameter descriptions list atTemplate:Navbox/doc). Most importantly, each template can be used as a child of one another. Using the inline notation, then_type= parameter can be set towith columns orwith collapsible groups to set the type of that child navbox, as shown in the example below. Press the edit button for the section to view the code.

Navbox with Collapsible Groups with nested regular Navbox, Navbox with Collapsible Groups, and Navbox with Columns
Regular Navbox
Group 1
  • List 1.1
  • List 1.2
Group 2
  • List 2.1
  • List 2.2
Navbox with Collapsible Groups
Group 1
  • List 1.1
  • List 1.2
Group 2
  • List 2.1
  • List 2.2
Navbox with Columns
Column 1Column 2
  • List 1.1
  • List 1.2
  • List 2.1
  • List 2.2

You can also nest these navbox templates by using the|border=child parameter, or by specifying the first unnamed parameter to bechild. For example:{{Navbox|child ...}},{{Navbox with columns|child ...}} or{{Navbox with collapsible groups|child ...}}. Note that this style of nesting can lead to a large increase in the template'spost-expand include size.

Technical details

[edit]

See also

[edit]
Navigation templates comparison
TemplateCollapsibleImageGroupsStyle (body)
parameter/s
{{Navbox}}collapsibleLeft/right of bodyYesYes
{{Navbox with collapsible groups}}collapsibleLeft/right of body and/or in each listYesYes
{{Navbox with columns}}collapsibleLeft/right of columnsNoYes
Collapsible attributes
TypeCSS classesJavaScriptCollapses whenCustom
initial state
Nesting
Collapsible tablesmw-collapsiblejQuery.makeCollapsible2 or more autocollapse on pageYesYes


Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Navbox_with_collapsible_groups/doc&oldid=1271548606"
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp