Template:Spoiler: Difference between revisions
Created page with "<div class="mw-collapsible mw-collapsed" data-collapsetext="Hide {{{2|}}}" data-expandtext="Show {{{2|}}}"> <div style="border: 1px solid black;padding: 0.5em;background: whitesmoke">{{{1}}}</div></div><noinclude> A collapsible block with custom text for the toggle label. For example: <pre>{{Spoiler|The cake is a lie!}}</pre> produces: {{Spoiler|The cake is a lie!}} You can add a second argument if you want to customise the toggle label: <pre>{{Spoiler||The cake is a l..." |
m Matches Common.js and Common.css |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<div class=" | <div class="collapsible-hint">[ <span class="collapsible-hint-link">{{#if:{{{2|}}}| {{{2}}}|}}</span> ]</div> | ||
<div | <div class="collapsible-hint-content"><div class="collapsible-hint-padded">{{{1}}}</div></div><noinclude> | ||
A collapsible block with custom text for the toggle label. | A collapsible block with custom text for the toggle label. | ||
Line 9: | Line 9: | ||
You can add a second argument if you want to customise the toggle label: | You can add a second argument if you want to customise the toggle label: | ||
<pre>{{Spoiler | <pre>{{Spoiler|The cake is a lie!|massive spoiler}}</pre> | ||
produces: | produces: | ||
{{Spoiler|The cake is a lie!|massive spoiler}} | {{Spoiler|The cake is a lie!|massive spoiler}} | ||
</noinclude> | |||
<templatedata> | |||
{ | |||
"params": { | |||
"1": { | |||
"label": "Contents", | |||
"description": "This will be collapsed by default and will appear when the user clicks a \"Show\" button.", | |||
"type": "content", | |||
"required": true | |||
}, | |||
"2": { | |||
"label": "Label", | |||
"description": "If included, the button can read, e.g., \"Show hint\" instead of the default \"Show\".", | |||
"example": "hint", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"hint", | |||
"solution" | |||
] | |||
} | |||
}, | |||
"description": "A collapsible block.", | |||
"paramOrder": [ | |||
"2", | |||
"1" | |||
] | |||
} | |||
</templatedata></noinclude> |
Latest revision as of 17:09, 2 December 2023
[ ]
{{{1}}}
A collapsible block with custom text for the toggle label.
For example:
{{Spoiler|The cake is a lie!}}
produces:
[ ]
The cake is a lie!
You can add a second argument if you want to customise the toggle label:
{{Spoiler|The cake is a lie!|massive spoiler}}
produces:
[ massive spoiler ]
The cake is a lie!
A collapsible block.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Label | 2 | If included, the button can read, e.g., "Show hint" instead of the default "Show".
| String | optional |
Contents | 1 | This will be collapsed by default and will appear when the user clicks a "Show" button. | Content | required |