Template:Spoiler: Difference between revisions

From MENACE Official Wiki
mNo edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><span class="spoiler-content"><span>{{{1|{{{content}}}}}}</span></span></includeonly><noinclude>
<includeonly><{{#ifeq: {{{type|}}}|block|div|{{#ifeq: {{{type|}}}|image|div|span|}}}} class="spoiler-content {{#if: {{{blur|}}}|blur|{{#ifeq: {{{type|}}}|image|blur|block|}}}}"><span>{{{1|{{{content}}}}}}</span></{{#ifeq: {{{type|}}}|block|div|{{#ifeq: {{{type|}}}|image|div|span|}}}}></includeonly><noinclude>
== Overview ==
== Overview ==
Use this spoiler tag to hide text until it is revealed by clicking on it. It can then be toggled back on by clicking again.
Use this spoiler tag to hide text until it is revealed by clicking on it. It can then be toggled back on by clicking again.


Currently, this template can only be used for inline spoilers and not for those spanning multiple lines.
The spoiler works for inline text and multiple paragraphs. It can hide templates, but once opened, they might not be able to be hidden again.
 
'''[This currently does not work for MediaWiki files that use the <code>frame</code> or <code>thumb</code> parameters]'''


== Parameters ==
== Parameters ==
Line 10: Line 12:
|-
|-
| <code>1</code> or <code>content</code> || required || Content of the spoiler || <code>content=This is a spoiler!</code>
| <code>1</code> or <code>content</code> || required || Content of the spoiler || <code>content=This is a spoiler!</code>
|-
| <code>type</code> || optional || Is the content of the spoiler an image or a big text block || <code>type=block</code> or <code>type=image</code>
|-
| <code>blur</code> || optional || Should the text be blurred instead of blocked? || <code>blur=y</code> or <code>blur=yes</code>
|}
|}


Line 21: Line 27:


Example text before the spoiler: {{Spoiler|This is a spoiler!}} And an example text after the spoiler.
Example text before the spoiler: {{Spoiler|This is a spoiler!}} And an example text after the spoiler.
----
To hide text that spans multiple lines, use:
<pre>
{{Spoiler|type=block|
This is a long spoiler!
It uses multiple lines!!!
}}
</pre>
to get this:
{{Spoiler|type=block|
This is a long spoiler!
It is uses multiple lines!!!
}}
----
To hide text, both inline or multiple lines, by blurring, use:
<pre>
{{Spoiler|type=block|blur=yes|
This is a long spoiler!
It is uses multiple lines!!!
}}
</pre>
to get this:
{{Spoiler|type=block|blur=yes|
This is a long spoiler!
It is uses multiple lines!!!
}}
----
Hide images by using <code>type=image</code>: '''[This currently does not work for MediaWiki files that use the <code>frame</code> or <code>thumb</code> parameters]'''
<pre>
{{Spoiler|type=image|[[File:Promotion 16.png]]}}
</pre>
to get this:
{{Spoiler|type=image|[[File:Promotion 16.png|This is a caption]]}}


----
----


The spoiler template is based on this [https://terraria.wiki.gg/wiki/Template:Spoiler template]
The spoiler template is based on this [https://terraria.wiki.gg/wiki/Template:Spoiler template]

Latest revision as of 14:44, 2 February 2026

Overview

Use this spoiler tag to hide text until it is revealed by clicking on it. It can then be toggled back on by clicking again.

The spoiler works for inline text and multiple paragraphs. It can hide templates, but once opened, they might not be able to be hidden again.

[This currently does not work for MediaWiki files that use the frame or thumb parameters]

Parameters

Parameter Description Example
1 or content required Content of the spoiler content=This is a spoiler!
type optional Is the content of the spoiler an image or a big text block type=block or type=image
blur optional Should the text be blurred instead of blocked? blur=y or blur=yes

Example

To hide text inline, use:

Example text that is before the spoiler: {{Spoiler|This is a spoiler!}} And an example text after the spoiler.

to get this:

Example text before the spoiler: This is a spoiler! And an example text after the spoiler.


To hide text that spans multiple lines, use:

{{Spoiler|type=block|
This is a long spoiler!

It uses multiple lines!!!
}}

to get this:

This is a long spoiler!

It is uses multiple lines!!!


To hide text, both inline or multiple lines, by blurring, use:

{{Spoiler|type=block|blur=yes|
This is a long spoiler!

It is uses multiple lines!!!
}}

to get this:

This is a long spoiler!

It is uses multiple lines!!!


Hide images by using type=image: [This currently does not work for MediaWiki files that use the frame or thumb parameters]

{{Spoiler|type=image|[[File:Promotion 16.png]]}}

to get this:

This is a caption

The spoiler template is based on this template