Template:Spoiler: Difference between revisions

From The Talos Principle Wiki
No edit summary
m TemplateData
Line 9: Line 9:


You can add a second argument if you want to customise the toggle label:
You can add a second argument if you want to customise the toggle label:
<pre>{{Spoiler||The cake is a lie!|massive spoiler}}</pre>
<pre>{{Spoiler|The cake is a lie!|massive spoiler}}</pre>
produces:
produces:
{{Spoiler|The cake is a lie!|massive spoiler}}
{{Spoiler|The cake is a lie!|massive spoiler}}
</noinclude>
 
<templatedata>
{
"params": {
"1": {
"label": "Contents",
"description": "This will be collapsed by default and will appear when the user clicks a \"Show\" button.",
"type": "content",
"required": true
},
"2": {
"label": "Label",
"description": "If included, the button can read, e.g., \"Show hint\" instead of the default \"Show\".",
"example": "hint",
"type": "string",
"suggestedvalues": [
"hint",
"solution"
]
}
},
"description": "A collapsible block.",
"paramOrder": [
"2",
"1"
]
}
</templatedata></noinclude>

Revision as of 14:28, 22 November 2023

[ ]
{{{1}}}

A collapsible block with custom text for the toggle label.

For example:

{{Spoiler|The cake is a lie!}}

produces:

[ ]
The cake is a lie!

You can add a second argument if you want to customise the toggle label:

{{Spoiler|The cake is a lie!|massive spoiler}}

produces:

[ massive spoiler ]
The cake is a lie!

A collapsible block.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Label2

If included, the button can read, e.g., "Show hint" instead of the default "Show".

Suggested values
hint solution
Example
hint
Stringoptional
Contents1

This will be collapsed by default and will appear when the user clicks a "Show" button.

Contentrequired