Template:Spoiler: Difference between revisions
From Step Mods | Change The Game
TechAngel85 (talk | contribs) mNo edit summary |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--><div id="collapse-pre-one" class="mw-collapsible mw-collapsed spoiler"><!-- | --><div id="collapse-pre-one" class="mw-collapsible mw-collapsed spoiler ml-{{{margin|0}}}"><!-- | ||
SPOILER TOGGLE | SPOILER TOGGLE | ||
--><div class="mw-collapsible-toggle"><span class="up small">➕ [Click to show]</span><span class="down small">➖ [Click to hide]</span> <span class=stepTitle>{{{shown}}}</span><!-- | --><div class="mw-collapsible-toggle"><span class="up small">➕ [Click to show]</span><span class="down small">➖ [Click to hide]</span> <span class=stepTitle>{{{shown|Spoiler heading}}}</span><!-- | ||
SPOILER CONTENT | SPOILER CONTENT | ||
--></div><div class="mw-collapsible-content spoiler-content p-2 pl-4"><!-- THIS IMPLICIT BREAK IS INTENDED! --> | --></div><div class="mw-collapsible-content spoiler-content p-2 pl-4"><!-- THIS IMPLICIT BREAK IS INTENDED! --> | ||
{{{hidden}}}</div><!-- | {{{hidden|Spoiler content}}}</div><!-- | ||
--></div><!-- | --></div><!-- | ||
--></includeonly><noinclude>__NOTOC__ [[Category:Instruction Templates]][[Category:Formatting Templates]][[Category:Layout Templates]][https://stepmodifications.org/forum/topic/5882-spoiler/ '''Forum Topic'''] | --></includeonly><noinclude>__NOTOC__ [[Category:Instruction Templates]][[Category:Formatting Templates]][[Category:Layout Templates]][https://stepmodifications.org/forum/topic/5882-spoiler/ '''Forum Topic'''] | ||
Line 13: | Line 13: | ||
{ | { | ||
"params": { | "params": { | ||
"margin": { | |||
"description": "Sets Bootstrap left margin for indentation.", | |||
"example": "Valid values are integers 1-5", | |||
"type": "number", | |||
"default": "0", | |||
"suggestedvalues": ["2","3","4"], | |||
"required": false | |||
}, | |||
"shown": { | "shown": { | ||
"description": "The instruction title", | "description": "The instruction title", | ||
Line 36: | Line 44: | ||
'''Result:''' | '''Result:''' | ||
{{Spoiler|shown=Instructions|hidden=Hidden content}} | {{Spoiler|shown=Instructions|hidden=Hidden content}} | ||
'''Code:''' | |||
<pre>{{Spoiler|margin=2|shown=Indenting|hidden=Use this optional parameter for indenting spoilers, because wikitext cannot be used as such.}} | |||
{{Spoiler|margin=3|shown=Practical Indentation Values|hidden=This site uses Boostrap for consistency, so the only valid values are 1-5. The only practical values are 2, 3, or 4.}} | |||
{{Spoiler|margin=4|shown=Default Value|hidden=The default value is 0 (no indentation) if this optional parameter is omitted.}}</pre> | |||
'''Result:''' | |||
{{Spoiler|margin=2|shown=Indenting|hidden=Use this optional parameter for indenting spoilers, because wikitext cannot be used as such.}} | |||
{{Spoiler|margin=3|shown=Practical Indentation Values|hidden=This site uses Boostrap for consistency, so the only valid values are 1-5. The only practical values are 2, 3, or 4.}} | |||
{{Spoiler|margin=4|shown=Default Value|hidden=The default value is 0 (no indentation) if this optional parameter is omitted.}} | |||
'''Code:''' | '''Code:''' | ||
Line 49: | Line 67: | ||
'''Code:''' | '''Code:''' | ||
<pre>{{Spoiler|shown=A Process|hidden= ===Include a heading=== | <pre>{{Spoiler|shown=A Process|hidden= ===Include a heading=== | ||
Headings | Headings work on the first line with no extra things in front of it.}}</pre> | ||
'''Result:''' | '''Result:''' |
Latest revision as of 05:34, January 14, 2024
Purpose & Usage
This allows a title to be clicked like a spoiler to show expandedhidden content beneath the title.
Parameter | Description | Type | Status | |
---|---|---|---|---|
margin | margin | Sets Bootstrap left margin for indentation.
| Number | optional |
shown | shown | The instruction title
| String | required |
hidden | hidden | Expanded content
| Content | required |
Examples
Code:
{{Spoiler|shown=Instructions|hidden=Hidden content}}
Result:
➕ [Click to show]➖ [Click to hide] Instructions
Hidden content
Code:
{{Spoiler|margin=2|shown=Indenting|hidden=Use this optional parameter for indenting spoilers, because wikitext cannot be used as such.}} {{Spoiler|margin=3|shown=Practical Indentation Values|hidden=This site uses Boostrap for consistency, so the only valid values are 1-5. The only practical values are 2, 3, or 4.}} {{Spoiler|margin=4|shown=Default Value|hidden=The default value is 0 (no indentation) if this optional parameter is omitted.}}
Result:
➕ [Click to show]➖ [Click to hide] Indenting
Use this optional parameter for indenting spoilers, because wikitext cannot be used as such.
➕ [Click to show]➖ [Click to hide] Practical Indentation Values
This site uses Boostrap for consistency, so the only valid values are 1-5. The only practical values are 2, 3, or 4.
➕ [Click to show]➖ [Click to hide] Default Value
The default value is 0 (no indentation) if this optional parameter is omitted.
Code:
{{Spoiler|shown=Procedure|hidden=# Beginning with a list now works. #*You can nest different types of lists. #*:It Just Works!}}
Result:
➕ [Click to show]➖ [Click to hide] Procedure
- Beginning with a list now works.
- You can nest different types of lists.
- It Just Works!
- You can nest different types of lists.
Code:
{{Spoiler|shown=A Process|hidden= ===Include a heading=== Headings work on the first line with no extra things in front of it.}}
Result:
➕ [Click to show]➖ [Click to hide] A Process
Include a heading
Headings now work on the first line with no extra things in front of it.Known Issues
- Incompatible with CSS extension
See Also