Template:Spoilers/doc: Difference between revisions

Content added Content deleted
(+)
Tag: 2017 source edit
 
(update)
Tag: 2017 source edit
Line 1: Line 1:
Puts small amounts of text into a clickable-to-reveal spoiler. Takes two parameters, <code>text</code> (what will be revealed on click) and <code>spoilertext</code> (a label; the latter is optional. You can also simply use them as the first and second parameter (unless the text has a <code>=</code>, for technical reasons), as shown:
Puts text into a clickable-to-reveal spoiler. Takes one parameter.


<code><nowiki>{{Spoilers|example}}</nowiki></code> yields {{Spoilers|example}}
<code><nowiki>{{Spoilers|example}}</nowiki></code> yields {{Spoilers|example}}

<code><nowiki>{{Spoilers|text=example}}</nowiki></code> yields {{Spoilers|text=example}}

<code><nowiki>{{Spoilers|example|label}}</nowiki></code> yields {{Spoilers|example|label}}

<code><nowiki>{{Spoilers|text=example|spoilertext=label}}</nowiki></code> yields {{Spoilers|text=example|spoilertext=label}}

<code><nowiki>{{Spoilers|2+2=4}}</nowiki></code> yields {{Spoilers|2+2=4}} &mdash; doesn't work!

<code><nowiki>{{Spoilers|text=2+2=4}}</nowiki></code> yields {{Spoilers|text=2+2=4}} &mdash; works.

== See also ==
* [[Wiki:Style Guide#Spoilers]], which also shows an alternative way to spoiler large amounts of text

Revision as of 03:50, 24 February 2022

Puts small amounts of text into a clickable-to-reveal spoiler. Takes two parameters, text (what will be revealed on click) and spoilertext (a label; the latter is optional. You can also simply use them as the first and second parameter (unless the text has a =, for technical reasons), as shown:

{{Spoilers|example}} yields

 

{{Spoilers|text=example}} yields Click to revealexample

{{Spoilers|example|label}} yields
 

{{Spoilers|text=example|spoilertext=label}} yields Click to revealexample

{{Spoilers|2+2=4}} yields
 
— doesn't work!

{{Spoilers|text=2+2=4}} yields Click to reveal2+2=4 — works.

See also