Template:Collapsible
This template creates a collapsible <div> using the mw-collapsible class and jQuery.makeCollapsible code in MediaWiki:Common.js. It displays the first parameter with a [Collapse] link on the right. If [Collapse] is clicked by the user, the second parameter collapsible text is hidden and the [Collapse] link becomes [Expand]. Clicking on [Expand] then shows the text again and the [Expand] link becomes [Collapse] again.
This template may be used as a simple alternative to the various templates based on NavFrame, NavHead, and NavContent. In particular, this template may be used to create hidden content that will be included when the page is printed. Content using NavFrame-based templates content cannot be printed.
Usage
- Default
- {{Collapsible|Constant content|Collapsible content}}
- Initially Collapsed
- {{Collapsible|Constant content|Collapsible content|collapsed=true}}
- No Constant Text
- {{Collapsible||Collapsible content}}
- Custom Labels
- {{Collapsible|Constant content|Collapsible content|expandtext=show|collapsetext=hide}}
- Custom Toggle
- {{Collapsible toggle|Toggle content|toggle=1}}
- {{Collapsible||Collapsible content|toggle=1}}
- Style
- {{Collapsible|Constant content|Collapsible content|style=style}}
- CollapsibleStyle
- {{Collapsible|Constant content|Collapsible content|collapsiblestyle=style}}
Examples
Default
Initially Collapsed
No Constant Content
Custom Labels
Custom Labels 2
Custom Toggle
Style
CollapsibleStyle
See also
http://en.wikiversity.org/wiki/Template:Collapsible
The above documentation is transcluded from Template:Collapsible/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |