Template:Collapsible list

From Wikisource
Jump to: navigation, search
Documentation icon Template documentation[view] [edit] [history] [purge]


This template produces a collapsible list. It is possible to set CSS styles for the "frame" (the div tags surrounding the list), for the list title, and for the list items. The template supports an unlimited number of list items.

Syntax[edit]

{{collapsible list
 |expand     = <!--(optional)-->
 |framestyle = <!--(optional)-->
 |titlestyle = <!--(optional)-->
 |title = 
 |liststyle  = <!--(optional)-->
 |hlist      = <!--(optional)-->
 |bullets    = <!--(optional)-->
 | [1 = ]      <!--(First item in list; the "1 =" is usually optional)-->
 | [2 = ]      <!--(Second item in list; ditto)-->
 | [3 = ]      <!--(Third item in list; etc.)--->
 | ...
}}

Parameters[edit]

  • Positional parameters (1, 2, 3...) - these are the list items. If no list items are present, the module will output nothing.
  • expand - specifying expand = true, or any non-blank value, will set the default state to expanded.
  • framestyle - a custom css style for the div tags surrounding the list, e.g. font-size: 90%;.
  • titlestyle - a custom css style for the div tags surrounding the title.
  • title - the list title.
  • titlestyle - a custom css style for the ul tags surrounding the list.
  • hlist - specifying hlist = true, or any non-blank value, will cause the template to output a horizontal list.
  • bullets - specifying bullets = true, or any non-blank value, will cause the template to produce bullets for each list item.

Examples[edit]

{{Collapsible list
 |framestyle = border:none; padding:1px;
 |title = List of Gitmo related EOs
 |titlestyle = font-weight:bold; color:yellow; margin:0em 4.0em 0.5em 0em; width:400px;
 |1 = • [[Military Order of November 13, 2001]]
 |2 = • [[Executive Order 13425]], February 14, 2007
 |3 = • [[Executive Order 13440]], July 20, 2007
 |4 = • [[Executive Order 13492]], January 22, 2009
}}


Example of a list without borders because it's within an infobox[edit]

In these examples, the fields leader_name2 and leader_name3 have been changed to use collapsible list.
{{Infobox settlement
|official_name     = City of Hamilton
|motto             = Together Aspire - Together Achieve
|image_skyline     = HamiltonOntarioSkylineC.JPG
|imagesize         = 250px
|image_caption     = 
|image_map         = Map of Ontario HAMILTON.svg
|mapsize           = 200px
|map_caption       = Location in the province of Ontario, Canada
|subdivision_type  = Country
|subdivision_name  = [[Canada]]
|subdivision_type1 = [[Provinces of Canada|Province]]
|subdivision_name1 = [[Ontario]]
|leader_title      = [[Mayor]]
|leader_name       = [[Fred Eisenberger]]
|leader_title1     = [[City Council]]
|leader_name1      = [[Hamilton City Council]]
|leader_title2     = [[Member of Parliament (Canada)|MPs]]
|leader_name2      =
 {{Collapsible list
  |framestyle=border:none; padding:0; <!--Hides borders and improves row spacing-->
  |title=List of MPs
  |1=[[Dean Allison]] |2=[[Chris Charlton]] |3=[[David Christopherson]] |4=[[Wayne Marston]] |5=[[David Sweet]]
 }}
|leader_title3     = [[Member of Provincial Parliament (Ontario)|MPPs]]
|leader_name3      =
 {{Collapsible list
  |framestyle=border:none; padding:0; <!--as above-->
  |title=List of MPPs
  |1=[[Marie Bountrogianni]] |2=[[Andrea Horwath]] |3=[[Judy Marsales]] |4=[[Ted McMeekin]] |5=[[Jennifer Mossop]]
 }}
|established_title = [[Municipal corporation|Incorporated]]
|established_date  = June 9, 1846
}}
<pre style="font-size:95%; overflow:auto;">
{{Infobox settlement
|official_name     = City of Hamilton
 ...truncated... 
|leader_title      = [[Mayor]]
|leader_name       = [[Fred Eisenberger]]
|leader_title1     = [[City Council]]
|leader_name1      = [[Hamilton City Council]]
|leader_title2     = [[Member of Parliament (Canada)|MPs]]
|leader_name2      =
 {{Collapsible list
  |framestyle=border:none; padding:0; <!--Hides borders and improves row spacing-->
  |title=List of MPs
  |1=[[Dean Allison]] |2=[[Chris Charlton]] |3=[[David Christopherson]] |4=[[Wayne Marston]] |5=[[David Sweet]]
 }}
|leader_title3     = [[Member of Provincial Parliament (Ontario)|MPPs]]
|leader_name3      =
 {{Collapsible list
  |framestyle=border:none; padding:0; <!--as above-->
  |title=List of MPPs
  |1=[[Marie Bountrogianni]] |2=[[Andrea Horwath]] |3=[[Judy Marsales]] |4=[[Ted McMeekin]] |5=[[Jennifer Mossop]]
 }}
|established_title = [[Municipal corporation|Incorporated]]
|established_date  = June 9, 1846
 (...etc...)
}}