Template:Spoiler: Difference between revisions

From Step Mods | Change The Game
mNo edit summary
mNo edit summary
Line 11: Line 11:
==Examples==
==Examples==
'''Code:'''
'''Code:'''
<pre>{{Spoiler|shown=Click Me!|hidden=
<pre>{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}</pre>
#Where did this come from?}}</pre>


'''Result:'''
'''Result:'''
{{Spoiler|shown=Click Me!|hidden=&nbsp;<br>
{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}
#Where did this come from?}}
 
'''Code:'''
<pre>{{Spoiler|shown=Click Me!|hidden=<br>
# Beginning with a list}}</pre>
 
'''Result:'''
{{Spoiler|shown=Click Me!|hidden=<br>
# Beginning with a list}}
 
'''Code:'''
<pre>{{Spoiler|shown=Click Me!|hidden=<br>
==Beginning with a heading==}}</pre>
 
'''Result:'''
{{Spoiler|shown=Click Me!|hidden=<br>
==Beginning with a heading==}}


== Known Issues ==
== Known Issues ==
*Incompatible with CSS extension
* Wiki markup for lists and headings will not be honored unless a <code><nowiki><br></nowiki></code> tag is used.
* Incompatible with CSS extension


== See Also ==
== See Also ==

Revision as of 16:46, March 22, 2021


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 text clicked to show the hidden content
  • parameter hidden is the hidden content
  • 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[edit source]

Code:

{{Spoiler|shown=Click Me!|hidden=Where did this come from?}}

Result:

➕ Click Me!
Where did this come from?

Code:

{{Spoiler|shown=Click Me!|hidden=<br>
# Beginning with a list}}

Result:

➕ Click Me!

  1. Beginning with a list

Code:

{{Spoiler|shown=Click Me!|hidden=<br>
==Beginning with a heading==}}

Result: {{Spoiler|shown=Click Me!|hidden=
==Beginning with a heading==}}

Known Issues[edit source]

  • Wiki markup for lists and headings will not be honored unless a <br> tag is used.
  • Incompatible with CSS extension

See Also[edit source]

No similar templates known.