Template:Navbox with collapsible groups: Difference between revisions
No edit summary |
No edit summary |
||
(7 intermediate revisions by 4 users not shown) | |||
Line 185: | Line 185: | ||
}} | }} | ||
| {{{list11|}}} | | {{{list11|}}} | ||
}} | |||
|list12 = | |||
{{#if:{{{group12|}}}{{{sect12|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr12}}} |uncollapsed |{{{state12|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group12style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group12<includeonly>|</includeonly>}}}{{{sect12|}}} | |||
|list1 = {{{list12<includeonly>|</includeonly>}}} | |||
|image = {{{image12|}}} | |||
|imageleft = {{{imageleft12|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list12|}}} | |||
}} | |||
|list13 = | |||
{{#if:{{{group13|}}}{{{sect13|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr13}}} |uncollapsed |{{{state13|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group13style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group13<includeonly>|</includeonly>}}}{{{sect13|}}} | |||
|list1 = {{{list13<includeonly>|</includeonly>}}} | |||
|image = {{{image13|}}} | |||
|imageleft = {{{imageleft13|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list13|}}} | |||
}} | |||
|list14 = | |||
{{#if:{{{group14|}}}{{{sect14|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr14}}} |uncollapsed |{{{state14|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group14style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group14<includeonly>|</includeonly>}}}{{{sect14|}}} | |||
|list1 = {{{list14<includeonly>|</includeonly>}}} | |||
|image = {{{image14|}}} | |||
|imageleft = {{{imageleft14|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list14|}}} | |||
}} | |||
|list15 = | |||
{{#if:{{{group15|}}}{{{sect15|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr12}}} |uncollapsed |{{{state15|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group15style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group15<includeonly>|</includeonly>}}}{{{sect15|}}} | |||
|list1 = {{{list15<includeonly>|</includeonly>}}} | |||
|image = {{{image15|}}} | |||
|imageleft = {{{imageleft15|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list15|}}} | |||
}} | |||
|list16 = | |||
{{#if:{{{group16|}}}{{{sect16|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr16}}} |uncollapsed |{{{state16|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group16style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group16<includeonly>|</includeonly>}}}{{{sect16|}}} | |||
|list1 = {{{list16<includeonly>|</includeonly>}}} | |||
|image = {{{image16|}}} | |||
|imageleft = {{{imageleft16|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list16|}}} | |||
}} | |||
|list17 = | |||
{{#if:{{{group17|}}}{{{sect17|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr17}}} |uncollapsed |{{{state17|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group17style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group17<includeonly>|</includeonly>}}}{{{sect17|}}} | |||
|list1 = {{{list17<includeonly>|</includeonly>}}} | |||
|image = {{{image17|}}} | |||
|imageleft = {{{imageleft17|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list17|}}} | |||
}} | }} | ||
|list18 = | |||
{{#if:{{{group18|}}}{{{sect18|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr18}}} |uncollapsed |{{{state18|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group18style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group18<includeonly>|</includeonly>}}}{{{sect18|}}} | |||
|list1 = {{{list18<includeonly>|</includeonly>}}} | |||
|image = {{{image18|}}} | |||
|imageleft = {{{imageleft18|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list18|}}} | |||
}} | |||
|list19 = | |||
{{#if:{{{group19|}}}{{{sect19|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr19}}} |uncollapsed |{{{state19|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group19style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group19<includeonly>|</includeonly>}}}{{{sect19|}}} | |||
|list1 = {{{list19<includeonly>|</includeonly>}}} | |||
|image = {{{image19|}}} | |||
|imageleft = {{{imageleft19|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list19|}}} | |||
}} | |||
|list20 = | |||
{{#if:{{{group20|}}}{{{sect20|}}} | |||
| {{Navbox|child | |||
|state = {{#ifeq:{{{selected}}}|{{{abbr20}}} |uncollapsed |{{{state20|collapsed}}}}} | |||
|titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group20style|}}} | |||
|liststyle = {{{liststyle|}}}{{{list1style|}}} | |||
|title = {{{group20<includeonly>|</includeonly>}}}{{{sect20|}}} | |||
|list1 = {{{list20<includeonly>|</includeonly>}}} | |||
|image = {{{image20|}}} | |||
|imageleft = {{{imageleft20|}}} | |||
|{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}} | |||
}} | |||
| {{{list20|}}} | |||
}} | |||
}}<noinclude>{{lock}} | }}<noinclude>{{lock}} | ||
{{documentation}} | {{documentation}} | ||
[[category: | [[category:navigation templates|{{PAGENAME}}]] | ||
</noinclude> | </noinclude> |
Latest revision as of 18:39, 22 February 2018
|
Usage
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 Template:T instead.
{{Navbox with collapsible groups |name = {{subst:PAGENAME}} |state = |selected = {{{1|}}} |title = |titlestyle = |groupstyle = |image = |group1 = |abbr1 = |list1 = |group2 = |abbr2 = |list2 = ... |group10 = |abbr10 = |list10 = }}
Parameters
This template shares many common parameters with its sister templates Template:T and Template:T. The common parameters are marked with a cross†. Please refer to the documentation of Template:T for more in depth descriptions and examples of those parameters.
Setup parameters
- name†
- The name of the template. The name of this template, for example, is "Navbox with collapsible groups".
- state† [
autocollapse, uncollapsed, collapsed, plain, off
] - The initial state of the show/hide feature for the main title. See Template:T for more information. Does not affect display or hiding of group items, see staten, below.
- state† [
- navbar†
- Possible values are
plain
,off
, and the default value of blank. See Template:T for more information.
- border†
- Possible values are
child
,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 Template:T, the columns of a Template:T, or a list area of Template:T. See Template:T for more information and examples.
Basic data parameters
- 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
- groupn†
- The title of each section.
- listn†
- The content/wikilinks that will be shown in the group. Use dots or bullets as separators (see the See also section). A Template:T or Template:T can optionally be used here with its
border = 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. See
selected
parameter below to see how to use this parameter. This parameter is optional, but recommended.
- selected
- If the value of
selected
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.
- staten [
autocollapse, uncollapsed, collapsed, plain, off
] - The initial collapsible state of listn. Set to collapsed by default. Overridden to uncollapsed if
selected
equalsabbrn
.
- staten [
- 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
- bodystyle†
- CSS style/s to apply to the entire template
- titlestyle†
- CSS style/s to apply to titlebar; usually
background:color
. The color of wikilink text must be manually changed using span tags. For example usetitle = [[Scouting|<span style="color:ivory;">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 the above and below parameters, respectively.
- basestyle†
- CSS style/s to apply to the title, above, below, and groupn parameters, all at the same time.
- imagestyle†
- CSS style/s to apply to the image parameter. Does not get applied to the imagen parameters.
- imageleftstyle†
- CSS style/s to apply to the imageleft parameter. Does not get applied to the imageleftn parameters.
- groupstyle†
- CSS style/s to apply to all group heading parameters. Visit this 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 in groupstyle.
- 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 in liststyle.
- listpadding†
- Padding to have in each list cell; defaults to 0.25em on the left/right and 0em on the top/bottom.
Examples
Basic example
{{Navbox with collapsible groups |name = University of Michigan |title = <span style="color:#FFD700;">The University of Michigan, Ann Arbor</span> |titlestyle = background:#00008B;color:#FFD700; |groupstyle = background:#FFD700;color:#00008B; |image = |selected = {{{1|}}} |state = collapsed |group1 = <span style="color:#00008B;">Academics</span> |abbr1 = academics |list1 = College of Engineering{{·}} College of Literature, Science and the Arts{{·}} Gerald R. Ford School of Public Policy{{·}} Law School{{·}} Medical School{{·}} Ross School of Business{{·}} School of Education{{·}} School of Information{{·}} School of Music, Theatre & Dance{{·}}School of Natural Resources and Environment{{·}} School of Public Health{{·}} Taubman College of Architecture and Urban Planning |group2 = [[Michigan Wolverines|<span style="color:#00008B;">Athletics</span>]] |abbr2 = athletics |list2 = Michigan Stadium{{·}} Crisler Arena{{·}} Yost Ice Arena{{·}} Michigan Wolverines{{·}} Football{{·}} UM-OSU Rivalry{{·}} Little Brown Jug{{·}} Paul Bunyan Trophy{{·}} Cold War |group3 = Campus |abbr3 = campus |list3 = Angell Hall Observatory{{·}} Burton Tower{{·}} The Diag{{·}} Dennison Building{{·}} Gerald R. Ford Presidential Library{{·}} Hill Auditorium{{·}} Lurie Tower{{·}} Matthaei Botanical Gardens{{·}} Michigan Union{{·}} Museums{{·}} Nichols Arboretum{{·}} UM Health System{{·}} University Library }}
|
This example shows Template:T, Template:T and Template:T all working together. Press the edit button for the section to view the code. Note that each of the child navboxes has the first parameter set to child
|