Template:Spoiler: Difference between revisions
(contrast tweak) |
(→Adding links: new section) |
||
Line 17: | Line 17: | ||
<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> | ||
=== Adding links === | |||
Because the site-wide CSS will style links (internal or external) with color, they will not be hidden by this template. The solution is to replace: | |||
: <code><nowiki>[http:</nowiki><var>//site.tld/path/</var><nowiki> ...]</nowiki></code> | |||
with | |||
: <code><nowiki>... [http:</nowiki><var>//site.tld/path/</var><nowiki>]</nowiki></code> | |||
and | |||
: <code><nowiki>[[</nowiki><var>Pagename</var><nowiki>|...]]</nowiki></code> | |||
with | |||
: <code><nowiki>... [https://wiki.openmw.org/index.php?title=</nowiki><var>Pagname</var><nowiki>]]</nowiki></code> | |||
[[Category:Templates]] | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Revision as of 16:22, 16 August 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 the 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}}
Adding links
Because the site-wide CSS will style links (internal or external) with color, they will not be hidden by this template. The solution is to replace:
[http://site.tld/path/ ...]
with
... [http://site.tld/path/]
and
[[Pagename|...]]
with
... [https://wiki.openmw.org/index.php?title=Pagname]]