Template:Collapsible

From Boston Linux User Groups Wiki
Jump to: navigation, search

This template creates a content field which can be shown/hidden by the click of a button.

Use the following form[edit source]

{{Collapsible
  | Content = 
  | Collapse text = (default = Collapse)
  | Expand text = (default = Expand)
  | Start hidden = (true or false, default = false)
  | Class = (class applied to the outermost <div>)
  | Before trigger = (text, html, wiki syntax to go before trigger; default = blank)
  | After trigger = (text, html, wiki syntax to go after trigger but before content; default = blank)
}}


Example 1[edit source]

Code[edit source]

{{Collapsible
  | Content = 
* Line one
* Line 2
* Line C
* Line IV
  | Collapse text = Collapse This
  | Expand text = 
  | Start hidden = true
  | Class = 
  | Before trigger = Click here to:&nbsp;
  | After trigger = !
}}

Result[edit source]

Click here to: !
 
  • Line one
  • Line 2
  • Line C
  • Line IV

Note: If you want a space between the colon in "Click here to:" and the expand/collapse button, you need to add a special character. Just typing a regular space (hitting the space bar) will not work, as MediaWiki will ignore this white space. Instead you need to add a Non-breaking space, by typing &nbsp; after the colon.

Example 2[edit source]

Code[edit source]

{{Collapsible
  | Content = 
* Line one
* Line 2
* Line C
* Line IV
  | Collapse text = Hide
  | Expand text = Show
  | Start hidden = 
  | Class = 
  | Before trigger =  
  | After trigger = 
}}

Result[edit source]

 
  • Line one
  • Line 2
  • Line C
  • Line IV