Template:Spoiler: Difference between revisions
m Protected "Template:Spoiler" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
m Altered #if category assignment based on namespace where the notice is used. Altered examples to use {{spoiler}} template instead of generic notice template. |
||
| (21 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly>{{notice|color=#FFCCCC| | <includeonly>{{notice|id=spoiler-notice | ||
| | |color=#FFCCCC | ||
-->{{#if:{{{text|}}}| | |header={{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{book|}}}{{{text|}}} | ||
-->{{#if:{{{1|}}}{{{book|}}}| | |This page or section contains spoilers for the following:<br> | ||
-->{{#if:{{{2|}}}|{{#if:{{{3|}}}| | |This page or section contains spoilers.}}<!-- | ||
-->{{#if:{{{3|}}}| | -->{{#if:{{{text|}}}|{{{text}}}{{#if:{{{1|}}}{{{book|}}}|<br>}}}}<!-- | ||
-->{{#if:{{{4|}}}| | -->{{#if:{{{1|}}}{{{book|}}}|''[[{{b|{{{1|{{{book}}}}}}}}|{{b|{{{1|{{{book}}}}}}|text=y}}]]''}}<!-- | ||
-->{{#if:{{{5|}}}| | -->{{#if:{{{2|}}}|{{#if:{{{3|}}}|}}<br>''[[{{b|{{{2}}}}}|{{b|{{{2}}}|text=y}}]]''}}<!-- | ||
-->{{#if:{{{6|}}}| | -->{{#if:{{{3|}}}|{{#if:{{{4|}}}||}}<br>''[[{{b|{{{3}}}}}|{{b|{{{3}}}|text=y}}]]''}}<!-- | ||
-->{{#if:{{{7|}}}| | -->{{#if:{{{4|}}}|{{#if:{{{5|}}}||}}<br>''[[{{b|{{{4}}}}}|{{b|{{{4}}}|text=y}}]]''}}<!-- | ||
--> | -->{{#if:{{{5|}}}|{{#if:{{{6|}}}||}}<br>''[[{{b|{{{5}}}}}|{{b|{{{5}}}|text=y}}]]''}}<!-- | ||
|Information contained herein may spoil plot points.<br>{{#if:{{{1|}}}{{{book|}}}| Proceed with caution if you have not read {{#if:{{{2|}}}|these books|this book}}.}} | -->{{#if:{{{6|}}}|{{#if:{{{7|}}}||}}<br>''[[{{b|{{{6}}}}}|{{b|{{{6}}}|text=y}}]]''}}<!-- | ||
-->{{#if:{{{7|}}}|<br>''[[{{b|{{{7}}}}}|{{b|{{{7}}}|text=y}}]]''}}<!-- | |||
--> | |||
|text=Information contained herein may spoil plot points.<br>{{#if:{{{1|}}}{{{book|}}}| Proceed with caution if you have not read {{#if:{{{2|}}}|these books|this book}}.}} | |||
|align={{{align|left}}} | |||
|width={{{width|}}} | |||
|dismiss={{{dismiss|}}} | |||
}}<!-- | }}<!-- | ||
-->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|[[Category:Articles with Spoilers]]}}{{#ifeq:{{NAMESPACE}}|{{ns:100}}|[[Category:Articles with Spoilers]]}}<!-- | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|[[Category:Articles with Spoilers]]}}{{#ifeq:{{NAMESPACE}}|{{ns:100}}|[[Category:Articles with Spoilers]]}}<!-- | ||
-->{{#if:{{{1|}}}{{{book|}}}|[[Category: Spoilers for {{b|{{{1|{{{book}}}}}}}}]]}}<!-- | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|<!-- | ||
-->{{#if:{{{2|}}}|[[Category: Spoilers for {{b|{{{2}}}}}]]}}<!-- | -->{{#if:{{{1|}}}{{{book|}}}|[[Category: Spoilers for {{b|{{{1|{{{book}}}}}}}}]]}}<!-- | ||
-->{{#if:{{{3|}}}|[[Category: Spoilers for {{b|{{{3}}}}}]]}}<!-- | -->{{#if:{{{2|}}}|[[Category: Spoilers for {{b|{{{2}}}}}]]}}<!-- | ||
-->{{#if:{{{4|}}}|[[Category: Spoilers for {{b|{{{4}}}}}]]}}<!-- | -->{{#if:{{{3|}}}|[[Category: Spoilers for {{b|{{{3}}}}}]]}}<!-- | ||
-->{{#if:{{{5|}}}|[[Category: Spoilers for {{b|{{{5}}}}}]]}}<!-- | -->{{#if:{{{4|}}}|[[Category: Spoilers for {{b|{{{4}}}}}]]}}<!-- | ||
-->{{#if:{{{6|}}}|[[Category: Spoilers for {{b|{{{6}}}}}]]}}<!-- | -->{{#if:{{{5|}}}|[[Category: Spoilers for {{b|{{{5}}}}}]]}}<!-- | ||
-->{{#if:{{{7|}}}|[[Category: Spoilers for {{b|{{{7}}}}}]]}}</includeonly><noinclude> | -->{{#if:{{{6|}}}|[[Category: Spoilers for {{b|{{{6}}}}}]]}}<!-- | ||
-->{{#if:{{{7|}}}|[[Category: Spoilers for {{b|{{{7}}}}}]]}}<!-- | |||
-->}}{{#ifeq:{{NAMESPACE}}|{{ns:100}}|<!-- | |||
-->{{#if:{{{1|}}}{{{book|}}}|[[Category: Spoilers for {{b|{{{1|{{{book}}}}}}}}]]}}<!-- | |||
-->{{#if:{{{2|}}}|[[Category: Spoilers for {{b|{{{2}}}}}]]}}<!-- | |||
-->{{#if:{{{3|}}}|[[Category: Spoilers for {{b|{{{3}}}}}]]}}<!-- | |||
-->{{#if:{{{4|}}}|[[Category: Spoilers for {{b|{{{4}}}}}]]}}<!-- | |||
-->{{#if:{{{5|}}}|[[Category: Spoilers for {{b|{{{5}}}}}]]}}<!-- | |||
-->{{#if:{{{6|}}}|[[Category: Spoilers for {{b|{{{6}}}}}]]}}<!-- | |||
-->{{#if:{{{7|}}}|[[Category: Spoilers for {{b|{{{7}}}}}]]}}<!-- | |||
-->}}</includeonly><noinclude> | |||
== Description == | == Description == | ||
This template should be used to indicate a page or section may contain spoilers. Using it automatically adds the page to [[:Category:Articles with Spoilers]]. | This template should be used to indicate a page or section may contain spoilers. Using it automatically adds the page to [[:Category:Articles with Spoilers]]. | ||
== Usage == | == Usage == | ||
To use, insert <code><nowiki>{{spoiler}}</nowiki></code> at the beginning of | To use, insert <code><nowiki>{{spoiler}}</nowiki></code> at the beginning of a page, after the infobox (if present), or beneath the relevant section heading. | ||
:'''Note:''' You can also pass <code>align=</code>, <code>width=</code>, and <code>dismiss=no</code> for more granular control of visual appearance. For more details on these parameters, see [[:Template:Notice]]. | |||
{| style="width: 100%; text-align: left; margin: auto;" class="wikitable" | {| style="width: 100%; text-align: left; margin: auto;" class="wikitable" | ||
|- | |- | ||
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Tag Only</span><br><span style="font-weight: normal;">Passing only the tag will add the spoiler notice to that page or section.</span> | ! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Tag Only</span><br><div style="text-align: left;"><span style="font-weight: normal;">Passing only the tag will add the spoiler notice to that page or section.</span></div> | ||
|- | |- | ||
! width=20%|You Type | ! width=20%|You Type | ||
!You Get | !You Get | ||
|- | |- | ||
| style="text-align: center | | style="text-align: center;" |<pre>{{spoiler}}</pre> | ||
|{{spoiler|width=83%|align=center}} | |||
|- | |- | ||
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Spoilers | ! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Spoilers for a Specific Book</span><br><div style="text-align: left;"><span style="font-weight: normal;">If you wish to specify what book the spoiler warning is regarding, simply pass that book's abbreviation from [[:Template:B]].</span></div> | ||
|- | |- | ||
! width=20%|You Type | ! width=20%|You Type | ||
!You Get | !You Get | ||
|- | |- | ||
| style="text-align: center | | style="text-align: center;" |<pre>{{spoiler|tbot}}</pre> | ||
|{{spoiler|tbot|width=83%|align=center}} | |||
|- | |- | ||
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Spoilers | ! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Spoilers for Two or More Books</span><br><div style="text-align: left;"><span style="font-weight: normal;">If you wish warn about spoilers from two or more books, simply pass a parameter for each book using that book's abbreviation from [[:Template:B]].<br><br><span style="font-size: 90%;">'''Note:''' This template is limited to a maximum of seven book abbreviations.</span></span></div> | ||
|- | |- | ||
! width=20%|You Type | ! width=20%|You Type | ||
!You Get | !You Get | ||
|- | |- | ||
| style="text-align: center | | style="text-align: center;" |<pre>{{spoiler|tbot|tq}}</pre> | ||
| style=" | |{{spoiler|tbot|tq|width=83%|align=center}} | ||
|- | |||
! colspan="2" style="text-align: center;" | <span style="font-size: 115%;">Spoilers for Non-Book Content</span><br><div style="text-align: left;"><span style="font-weight: normal;">If you wish warn about spoilers from content that is not book related—such as stories from ''The St. Crispian's Gazette''—or if you wish to add additional text to the notice, pass <code>text=</code>.</span></div> | |||
|- | |||
! width=20%|You Type | |||
!You Get | |||
|- | |||
| style="text-align: left;" |<pre>{{spoiler | |||
|text=Stories from ''The St. Crispian's Gazette'' | |||
}}</pre> | |||
|{{spoiler|text=Stories from ''The St. Crispian's Gazette''|align=center|width=83%}} | |||
|} | |} | ||