Difference between revisions of "Template:Collapse"
Jump to navigation
Jump to search
(Copied from Wikipedia http://en.wikipedia.org/wiki/Template:Collapse) |
(Remove restriction that it can't be used in the article namespace (Wikipedia no longer has that restriction, and beyond that we're not wikipedia and have a reason to collapse e.g. sample data)) |
||
Line 1: | Line 1: | ||
− | {| <!-- Template:Collapse --> class="mw-collapsible {{#switch:{{lc:{{{expand|no}}}}}|uncollapse|uncollapsed|expand|expanded|yes|y=mw-uncollapsed|#default=mw-collapsed}} {{{class|}}}" style=" | + | {| <!-- Template:Collapse --> class="mw-collapsible {{#switch:{{lc:{{{expand|no}}}}}|uncollapse|uncollapsed|expand|expanded|yes|y=mw-uncollapsed|#default=mw-collapsed}} {{{class|}}}" style="background-color: {{{bg1|transparent}}}; text-align: left; border: {{{border|1px}}} solid {{{b-color|silver}}}; {{{{{|safesubst:}}}#switch:{{{float|}}} |
| left = margin:0.2em 0.5em 0.2em 0; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; float: left; clear: {{{clear|left}}} | | left = margin:0.2em 0.5em 0.2em 0; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; float: left; clear: {{{clear|left}}} | ||
| right = margin:0.2em 0 0.2em 0.5em; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; float: right; clear: {{{clear|right}}} | | right = margin:0.2em 0 0.2em 0.5em; width:{{{{{|safesubst:}}}#if:{{{width|}}}|{{{width}}}|auto}}; float: right; clear: {{{clear|right}}} | ||
Line 11: | Line 11: | ||
| style="border: solid {{{border2|1px silver}}}; padding: {{{padding|8px}}}; background-color: {{{bg2|white}}};" | | | style="border: solid {{{border2|1px silver}}}; padding: {{{padding|8px}}}; background-color: {{{bg2|white}}};" | | ||
<div>{{{content|{{{text|{{{1<noinclude>|{{lorem ipsum|3}}</noinclude>}}}}}}}}}</div> | <div>{{{content|{{{text|{{{1<noinclude>|{{lorem ipsum|3}}</noinclude>}}}}}}}}}</div> | ||
− | | | + | |}<noinclude> |
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 22:53, 21 July 2019
Extended content |
---|
Used to create a collapsible box around some content.
Usage
The simplest usage is {{Collapse|text=Text to collapse|title=Header}}
.
This appears as:
Header |
---|
Text to collapse
|
There are several optional parameters, and the listed parameters have several aliases:
1
ortext
orcontent
: The text to collapse.2
ortitle
orreason
orheader
orheading
orresult
: The title to label the collapse box with; defaults to "Extended content".expand
: Set to one of "yes", "y", "uncollapse", "uncollapsed", "expand", or "expanded" to have the box expanded by default. If not set or set to another value (e.g. "no"), the content will be collapsed by default.class
: Additional CSS class.bg1
: Main background color.border
: Main border thickness.b-color
: Main border color.float
: CSS float, one of "left", "right", "center", or "none", or not set.clear
: Sides content should be cleared on. Default depends on the value of float.width
: Width of the box. Defaults to auto.background
orbg
: Header background color.left
: Left-align header.center
: Center header.fc
: Header foreground color.border2
: Content border style.padding
: Content padding.bg2
: Content background color.