Difference between revisions of "Template:Spoiler"

From Project: Gorgon Wiki
Jump to: navigation, search
m (For cases where you want to hide something that's not necessarily a spoiler, for the sake of saving space.)
m
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="spoilers gg-spoiler">
+
<div class="mw-collapsible mw-collapsed">
<span class="spoilers-button">
+
'''{{{1|Spoiler!}}}'''
<span class="spoilers-show" style="display:inline"><strong>{{{2|Spoiler!}}}</strong></span>
+
<div class="mw-collapsible-content" style="padding-left: 1em;">{{{2|Spoiler text.}}}</div>
<span class="spoilers-hide" style="display:none">Hide</span>
 
</span>
 
<div class="spoilers-body" style="display:none;">
 
{{{1|Spoiler text.}}}
 
 
</div>
 
</div>
</div><noinclude>
+
<noinclude>
 
 
 
==Description==
 
==Description==
Use this template to add a spoiler '''section''' to a page (for inline text use [[Template:Hint]] instead).
+
Use this template to add a spoiler box to a page (Also see [[Template:Hint]]).
 
 
This template replaces the tag provided by the <nowiki><spoiler></nowiki> extension. Originally it was intended to allow using tables (which the extension doesn't) but it turned out the template doesn't allow for it either. Still, it is recommended to use this template as we have more freedom to restyle it or change its behavior down the line if we want to.
 
  
 +
<!-- This template replaces the tag provided by the <nowiki><spoiler></nowiki> extension. Originally it was intended to allow using tables (which the extension doesn't) but it turned out the template doesn't allow for it either. Still, it is recommended to use this template as we have more freedom to restyle it or change its behavior down the line if we want to. -->
 +
This template allows for formatting of spoiler content.
 
====Known issues====
 
====Known issues====
* <span style="color:red">Tables can not be formatted inside the template.</span> Suggest using definition lists as a workaround.
+
* <span style="color:red">Tables may or may not be formatted inside the template.</span> Suggest using definition lists as a workaround.
* Spoiler content shouldn't be too huge anyway. If you want to hide a long table of info in a page, consider adding a link to another page.
 
== Alternate method ==
 
While the examples suggested in this template work in most areas, the Template tag works if you wish to display alternative text than "Spoiler"
 
<spoiler show="Text for the spoiler box goes here">
 
Type things here. Quotes and Tables do not display correctly.
 
</spoiler>
 
 
 
 
==Examples==
 
==Examples==
 
A basic spoiler like this may be better replaced with [[Template:Hint]]:
 
A basic spoiler like this may be better replaced with [[Template:Hint]]:
 
<pre>
 
<pre>
{{Spoiler|
+
{{Spoiler|Spoiler|
 
Sarina's clothes are not outside, but inside the [[Boarded up Basement]] dungeon.
 
Sarina's clothes are not outside, but inside the [[Boarded up Basement]] dungeon.
 
}}
 
}}
 
</pre>
 
</pre>
 
+
{{Spoiler|Spoiler|
A more complex spoiler, we use definition lists because '''a table can not be included inside it''':
+
Sarina's clothes are not outside, but inside the [[Boarded up Basement]] dungeon.
 +
}}
 +
This is an example of a spoiler used for a quest reward.
 
<pre>
 
<pre>
{{Spoiler|
+
{{Spoiler|Reward for Contacting Melandria's Brother
; Utility
+
|Reward: {{Item|Pumpkin}} x1, 300 Councils, 50 Favor}}
: ''Word of Power: Cure Bovinity'' ... Speaking this word causes you to stop being a cow if you are one.
 
; Teleports
 
: ''Word of Power: Teleport to Crypt'' ... Speaking this word teleports you to the crypt beneath the town of Serbule.
 
}}
 
 
</pre>
 
</pre>
 +
{{Spoiler|Reward for Contacting Melandria's Brother|
 +
{{Quote|Thank you so much for your help! Here, have a pumpkin.}}
 +
Reward: {{Item|Pumpkin}} x1, 300 Councils, 50 Favor}}
  
 
[[Category:Formatting templates|Spoiler]]
 
[[Category:Formatting templates|Spoiler]]
 
</noinclude>
 
</noinclude>

Latest revision as of 12:58, 21 September 2020

Spoiler!

Spoiler text.

Description

Use this template to add a spoiler box to a page (Also see Template:Hint).

This template allows for formatting of spoiler content.

Known issues

  • Tables may or may not be formatted inside the template. Suggest using definition lists as a workaround.

Examples

A basic spoiler like this may be better replaced with Template:Hint:

{{Spoiler|Spoiler|
Sarina's clothes are not outside, but inside the [[Boarded up Basement]] dungeon.
}}

Spoiler

Sarina's clothes are not outside, but inside the Boarded up Basement dungeon.

This is an example of a spoiler used for a quest reward.

{{Spoiler|Reward for Contacting Melandria's Brother
|Reward: {{Item|Pumpkin}} x1, 300 Councils, 50 Favor}}

Reward for Contacting Melandria's Brother

Thank you so much for your help! Here, have a pumpkin.

Reward: x1, 300 Councils, 50 Favor