Template:Spoiler: Difference between revisions

From OpenMW Wiki
Jump to navigation Jump to search
m (code fix)
(recode; had an error, and it looks broken when done in all white)
Line 1: Line 1:
<span class="spoiler" title="Highlight/select the spoiler material to see it.">{{#if:{{{2|}}}|{{{2}}}|Spoiler}}: <span style="color:#{{{color|FFFFFF}}};">{{{1|{{{content|<noinclude>Sample text here.</noinclude>}}}}}}</span></span><noinclude>
<span class="spoiler" title="Highlight/select the spoiler material to see it.">{{#if:{{{2|}}}|{{{2}}}|Spoiler}}: <span style="color:{{{color|#EEEEEE}}}; background:{{{color|#EEEEEE}}};">{{{1|{{{content|<noinclude>Sample text here.</noinclude>}}}}}}</span></span><noinclude>


== Documentation ==
== Documentation ==
Line 14: Line 14:
<code><nowiki>{{spoiler|1=The text to hide here. |Major spoiler}}</nowiki></code>
<code><nowiki>{{spoiler|1=The text to hide here. |Major spoiler}}</nowiki></code>


If a different color is needed, because the background color is different (e.g. inside a colorful sidebar), you can specify a hex color (without the <code>#</code> prefix) or a named CSS color:
If different colors are wanted (e.g. inside a colorful sidebar), you can specify a hex color ({{em|with}} the <code>#</code> prefix) or a named CSS color, for the text and its background:


<code><nowiki>{{spoiler|1=The text to hide here. |Major spoiler |color=A9C633}}</nowiki></code>
<code><nowiki>{{spoiler|1=The text to hide here. |Major spoiler |color=#A9C633}}</nowiki></code>


[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>

Revision as of 08:28, 18 July 2017

Spoiler: Sample text here.

Documentation

This "hides" spoiler material by making it white like the page background, so that one must highlight it to read it.

Usage:

{{spoiler|1=The text to hide here}}

The 1= (which can also be given as content=) is optional, but safest to include, since the template will break if the content include a = character anywhere in it.

You can change "Spoiler" wording (which gives a note when you over over it) to something else:

{{spoiler|1=The text to hide here. |Major spoiler}}

If different colors are wanted (e.g. inside a colorful sidebar), you can specify a hex color (with the # prefix) or a named CSS color, for the text and its background:

{{spoiler|1=The text to hide here. |Major spoiler |color=#A9C633}}