Template:Collapsible: Difference between revisions
From HorizonXI Wiki
m (extended documentation) |
m (added note about other collapsible templates) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><onlyinclude><span class="mw-collapsible mw-collapsed"><span class="mw-collapsible-content">{{{1}}}</span></span></onlyinclude></includeonly> | <includeonly><onlyinclude><span class="mw-collapsible {{#switch:{{{state|}}}|expanded=|collapsed=mw-collapsed|#default=mw-collapsed}}"><span class="mw-collapsible-content">{{{1}}}</span></span></onlyinclude></includeonly> | ||
__NOTOC__ | |||
==Usage== | ==Usage== | ||
===Inline Text=== | ===Inline Text=== | ||
<pre>The next piece of text is | <pre>The next piece of text can be collapsed but is by default expanded: {{ Collapsible | this can be collapsed | state=expanded}}</pre> | ||
The next piece of text | The next piece of text can be collapsed: {{ Collapsible | this can be collapsed | state=expanded}} | ||
===Lists=== | ===Lists=== | ||
Line 12: | Line 12: | ||
Lists need an extra linebreak between the template call and the list element that is supposed to be hidden | Lists need an extra linebreak between the template call and the list element that is supposed to be hidden | ||
<pre> | <pre>*Information here {{ Collapsible | | ||
**more information here | |||
}} | |||
*more list stuff</pre> | |||
*Information here {{ Collapsible | | *Information here {{ Collapsible | | ||
Line 18: | Line 21: | ||
}} | }} | ||
*more list stuff | *more list stuff | ||
===See also=== | |||
[[:Template:Collapsible Toggle]] and [[:Template:Collapsible Content]] if you want to place the toggle independently of the content thats going to be collapsed. | |||
==Editing this template== | |||
Further info can be found at | |||
*https://www.mediawiki.org/wiki/Manual:Collapsible_elements | |||
*https://www.mediawiki.org/wiki/Manual:Collapsible_elements/Demo/Advanced | |||
e.g. to add custom placement of the toggle element |
Latest revision as of 18:31, 27 November 2023
Usage
Inline Text
The next piece of text can be collapsed but is by default expanded: {{ Collapsible | this can be collapsed | state=expanded}}
The next piece of text can be collapsed: this can be collapsed
Lists
Lists need an extra linebreak between the template call and the list element that is supposed to be hidden
*Information here {{ Collapsible | **more information here }} *more list stuff
- Information here
- more information here
- more list stuff
See also
Template:Collapsible Toggle and Template:Collapsible Content if you want to place the toggle independently of the content thats going to be collapsed.
Editing this template
Further info can be found at
- https://www.mediawiki.org/wiki/Manual:Collapsible_elements
- https://www.mediawiki.org/wiki/Manual:Collapsible_elements/Demo/Advanced
e.g. to add custom placement of the toggle element