Template:Spoiler: Difference between revisions

From Step Mods | Change The Game
mNo edit summary
mNo edit summary
Line 17: Line 17:


'''Code:'''
'''Code:'''
<pre>{{Spoiler|shown=Click To Reveal Hidden List|hidden=<br>
<pre>{{Spoiler|shown=Click To Reveal Hidden List|hidden=some text, a <br>, or a &nbsp;
# Beginning with a list}}</pre>
# Beginning with a list}}</pre>


'''Result:'''
'''Result:'''
{{Spoiler|shown=Click To Reveal Hidden List|hidden=some text
{{Spoiler|shown=Click To Reveal Hidden List|hidden=some text, a <nowiki><br></nowiki>, or a <nowiki>&nbsp</nowiki>;
# Beginning with a list}}
# Beginning with a list}}


'''Code:'''
'''Code:'''
<pre>{{Spoiler|shown=Click To Reveal Hidden Heading|hidden=<br>
<pre>{{Spoiler|shown=Click To Reveal Hidden Heading|hidden=some text, a <br>, or a &nbsp;
some text
==Include a heading==
==Include a heading==
some text
some text, a <br>, a list, or a &nbsp;
}}</pre>
}}</pre>


'''Result:'''
'''Result:'''
{{Spoiler|shown=Click To Reveal Hidden Heading|hidden=some text
{{Spoiler|shown=Click To Reveal Hidden Heading|hidden=some text, a <nowiki><br></nowiki>, or a <nowiki>&nbsp</nowiki>;
==Include a heading==
==Include a heading==
some text
some text, a <nowiki><br></nowiki>, a list, or a <nowiki>&nbsp</nowiki>;
}}
}}


== Known Issues ==
== Known Issues ==
* Wiki markup for lists will not be honored unless a <code><nowiki><br></nowiki></code> tag is used at the beginning of the hidden text followed by a line break in the markup.
* Wiki markup for lists will not be honored unless placeholder text is used at the beginning of the hidden text followed by a line break in the markup.
* Wiki markup for headings will not be honored unless a <code><nowiki><br></nowiki></code> tag is used at the beginning of the hidden text and followed by a line break in the markup AND a line break in the markup followed by a <code><nowiki><br></nowiki></code> tag.
* 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 17:10, 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 To Reveal Hidden List|hidden=some text, a <br>, or a  
# Beginning with a list}}

Result:

➕ Click To Reveal Hidden List
some text, a <br>, or a  
  1. Beginning with a list

Code:

{{Spoiler|shown=Click To Reveal Hidden Heading|hidden=some text, a <br>, or a  
==Include a heading==
some text, a <br>, a list, or a  
}}

Result:

➕ Click To Reveal Hidden Heading
some text, a <br>, or a  

Include a heading

some text, a <br>, a list, or a  

Known Issues[edit source]

  • Wiki markup for lists will not be honored unless placeholder text is used at the beginning of the hidden text followed by a line break in the markup.
  • 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

See Also[edit source]

No similar templates known.