(Created page with "<noinclude> Used to hide spoiler content behind a collapsible section. Pair with Template:SpoilerSectionEnd. </noinclude> <onlyinclude> <div class="mw-collapsible mw-collapsed" style="overflow:auto;"> <div style="font-weight:bold; float:left; margin-right:0.5em;" >{{{1|Spoilers:}}}</div> <div class="mw-collapsible-toggle" style="float:left;">[Show/Hide]</div> <div class="mw-collapsible-content" style="clear:both;"> </onlyinclude>") |
(use inline formatting instead of block for more consistent source presentation) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <div class="mw-collapsible {{{collapsed|mw-collapsed}}} {{{class|}}}" style="overflow:auto;"><div style="display:inline-block; margin-right:0.5em; {{{style|font-weight:bold;}}}"> | ||
Used to hide | {{{label|{{{1|Spoilers:}}}}}} | ||
</div><div class="mw-collapsible-toggle" style="float:none; display:inline-block;">{{{button|[Show/Hide]}}}</div><div class="mw-collapsible-content" style="clear:both;"><noinclude>This text is part of the template doc. Hi! {{CollapseEnd}} | |||
Used to hide content behind a collapsible section. Pair with {{t|CollapseEnd}}. | |||
==Parameters== | |||
<templatedata> | |||
{ | |||
"description": "Start of a collapsible section.", | |||
"format": "inline", | |||
"params": { | |||
"label": { | |||
"label": "Label", | |||
"aliases": ["1"], | |||
"description": "The text to display before the [Show/Hide] button. Supports wikitext such as italics and headers.", | |||
"default": "Spoilers:", | |||
"type": "content", | |||
"suggested": true | |||
}, | |||
"button": { | |||
"label": "Toggle Button", | |||
"description": "Specify what text (or template) should be used as the collapsible section toggle.", | |||
"default": "[Show/Hide]", | |||
"type": "content" | |||
}, | |||
"class": { | |||
"label": "Section Class", | |||
"description": "Any CSS classes to style the entire collapsible section.", | |||
"example": "toccolours", | |||
"type": "line" | |||
}, | |||
"style": { | |||
"label": "Label Style", | |||
"description": "CSS styles to apply to the label.", | |||
"default": "font-weight:bold;", | |||
"type": "line" | |||
}, | |||
"collapsed": { | |||
"label": "Collapsed", | |||
"description": "Set to a blank value to prevent the section from being collapsed by default.", | |||
"type": "line" | |||
} | |||
} | |||
} | |||
</templatedata> | |||
==Sample== | |||
{{CollapseStart|Want the code to this sample?|button={{MWButton|Sure|class=progressive}}|class=toccolours}} | |||
Here's how this sample was made: | |||
<pre> | |||
{{CollapseStart|Want the code to this sample?|button={{MWButton|Sure|class=progressive}}|class=toccolours}} | |||
Here's how this sample was made: | |||
... | |||
{{CollapseEnd|Sample ends here.}} | |||
</pre> | |||
{{CollapseEnd|Sample ends here.}} | |||
[[Category:Formatting templates]] | |||
</noinclude> | </noinclude> | ||
Latest revision as of 23:27, 23 September 2024
Spoilers:
[Show/Hide]
This text is part of the template doc. Hi!
Used to hide content behind a collapsible section. Pair with {{CollapseEnd}}.
Parameters
Start of a collapsible section.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Label | label 1 | The text to display before the [Show/Hide] button. Supports wikitext such as italics and headers.
| Content | suggested |
Toggle Button | button | Specify what text (or template) should be used as the collapsible section toggle.
| Content | optional |
Section Class | class | Any CSS classes to style the entire collapsible section.
| Line | optional |
Label Style | style | CSS styles to apply to the label.
| Line | optional |
Collapsed | collapsed | Set to a blank value to prevent the section from being collapsed by default. | Line | optional |
Sample
Want the code to this sample?
Here's how this sample was made:
{{CollapseStart|Want the code to this sample?|button={{MWButton|Sure|class=progressive}}|class=toccolours}} Here's how this sample was made: ... {{CollapseEnd|Sample ends here.}}Sample ends here.