Template:Spoiler: Difference between revisions

From Step Mods | Change The Game
No edit summary
Line 1: Line 1:
<includeonly><div id="collapse-pre-one" class="mw-collapsible mw-collapsed" style="margin-bottom:1em;"><div class="mw-collapsible-toggle orangetx" style="float:none; cursor:pointer; display:{{#ifeq:{{{h2}}}|1|initial|inline-block}};"><span class="up">&#10133;</span><span class="down">&#10134;</span> {{{shown}}}</div><div class="mw-collapsible-content">{{{hidden}}}</div></div></includeonly><noinclude>__NOTOC____NOTITLE__ [[Category:Instruction Templates]][[Category:Formatting Templates]][[Category:Layout Templates]]
<includeonly><!--
--><div id="collapse-pre-one" class="mw-collapsible mw-collapsed spoiler"><!--
      SPOILER TOGGLE
    --><div class="mw-collapsible-toggle"><span class="up small">&#10133; [Click to show]</span><span class="down small">&#10134; [Click to hide]</span> <span class=orangetx>{{{shown}}}</span><!--
      SPOILER CONTENT
    --></div><div class="mw-collapsible-content spoiler-content p-2 pl-4">
{{{hidden}}}</div><!--
--></div><!--
--></includeonly><noinclude>__NOTOC____NOTITLE__ [[Category:Instruction Templates]][[Category:Formatting Templates]][[Category:Layout Templates]]


==Purpose & Usage==
==Purpose & Usage==
Line 5: Line 13:


===Parameters===
===Parameters===
*''parameter shown'' is the text clicked to show the hidden content
*''parameter shown'' is the 'shown' title of the toggle when collapsed
*''parameter hidden'' is the hidden content
*''parameter hidden'' is the hidden content under the toggle when expanded
*''parameter h2'' if set to 1 will make the shown text have the initial display property (useful for the header 2 level, since it is underlined).


==Examples==
==Examples==
'''Code:'''
'''Code:'''
<pre>{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}</pre>
<pre>{{Spoiler|shown=Instructions|hidden=Hidden content}}</pre>


'''Result:'''
'''Result:'''
{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}
{{Spoiler|shown=Instructions|hidden=Hidden content}}


'''Code:'''
'''Code:'''
<pre>{{Spoiler|shown=Click To Reveal Hidden List|hidden=some text, a <br>, or a &amp;nbsp;
<pre>{{Spoiler|shown=Procedure|hidden=# Beginning with a list now works.
# Beginning with a list}}</pre>
#*You can nest different types of lists.
#*:It Just Works!}}</pre>


'''Result:'''
'''Result:'''
{{Spoiler|shown=Click To Reveal Hidden List|hidden=some text, a <nowiki><br></nowiki>, or a &amp;nbsp;
{{Spoiler|shown=Procedure|hidden=# Beginning with a list now works.
# Beginning with a list}}
#*You can nest different types of lists.
#*:It Just Works!}}


'''Code:'''
'''Code:'''
<pre>{{Spoiler|shown=Click To Reveal Hidden Heading|hidden=some text, a <br>, or a &amp;nbsp;
<pre>{{Spoiler|shown=A Process|hidden= ===Include a heading===
===Include a heading===
Headings now work on the first line with no extra things in front of it.}}</pre>
some text, a <br>, a list, or a &amp;nbsp;}}</pre>


'''Result:'''
'''Result:'''
{{Spoiler|shown=Click To Reveal Hidden Heading|hidden=some text, a <nowiki><br></nowiki>, or a &amp;nbsp;
{{Spoiler|shown=A Process|hidden= ===Include a heading===
===Include a heading===
Headings now work on the first line with no extra things in front of it.}}
some text, a <nowiki><br></nowiki>, a list, or a &amp;nbsp;}}


== Known Issues ==
== Known Issues ==
* Wiki markup for lists will not be honored unless placeholder character or line break is used at the beginning of the hidden text. Place the list on a new line.
* Wiki markup for headings will not be honored unless placeholder text is used at the beginning of the hidden text and followed by a line break in the markup before the heading ''AND'' a line break in the markup after the heading followed by placeholder text.
* Incompatible with CSS extension
* Incompatible with CSS extension



Revision as of 23:38, April 18, 2023


Purpose & Usage[edit source]

This template allows text to be clicked like a spoiler to show hidden text immediately underneath it.

Parameters[edit source]

  • parameter shown is the 'shown' title of the toggle when collapsed
  • parameter hidden is the hidden content under the toggle when expanded

Examples[edit source]

Code:

{{Spoiler|shown=Instructions|hidden=Hidden content}}

Result:

➕ [Click to show]➖ [Click to hide] Instructions
Hidden content

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
  1. Beginning with a list now works.
    • You can nest different types of lists.
      It Just Works!

Code:

{{Spoiler|shown=A Process|hidden= ===Include a heading===
Headings now 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[edit source]

  • Incompatible with CSS extension

See Also[edit source]

No similar templates known.