Template:Spoiler: Difference between revisions

mNo edit summary
m Altered #if category assignment based on namespace where the notice is used. Altered examples to use {{spoiler}} template instead of generic notice template.
 
(47 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{notice|color=#FFCCCC|align=left|id=spoilers
<includeonly>{{notice|id=spoiler-notice
|b=This page or section contains spoilers<!--
|color=#FFCCCC
-->{{#if:{{{text|}}}|&nbsp;for {{{text}}}{{#if:{{{1|}}}{{{book|}}}|&nbsp;and}}}}<!--
|header={{#if:{{{1|}}}{{{2|}}}{{{3|}}}{{{4|}}}{{{5|}}}{{{6|}}}{{{7|}}}{{{book|}}}{{{text|}}}
-->{{#if:{{{1|}}}{{{book|}}}|&nbsp;for ''[[{{b|{{{1|{{{book}}}}}}}}|{{b|{{{1|{{{book}}}}}}|text=y}}]]''}}<!--
  |This page or section contains spoilers for the following:<br>
-->{{#if:{{{2|}}}|{{#if:{{{3|}}}|,|&nbsp;and}} ''[[{{b|{{{2}}}}}|{{b|{{{2}}}|text=y}}]]''}}<!--
  |This page or section contains spoilers.}}<!--
-->{{#if:{{{3|}}}|,{{#if:{{{4|}}}||&nbsp;and}} ''[[{{b|{{{3}}}}}|{{b|{{{3}}}|text=y}}]]''}}<!--
-->{{#if:{{{text|}}}|{{{text}}}{{#if:{{{1|}}}{{{book|}}}|<br>}}}}<!--
-->{{#if:{{{4|}}}|,{{#if:{{{5|}}}||&nbsp;and}} ''[[{{b|{{{4}}}}}|{{b|{{{4}}}|text=y}}]]''}}<!--
-->{{#if:{{{1|}}}{{{book|}}}|''[[{{b|{{{1|{{{book}}}}}}}}|{{b|{{{1|{{{book}}}}}}|text=y}}]]''}}<!--
-->{{#if:{{{5|}}}|,{{#if:{{{6|}}}||&nbsp;and}} ''[[{{b|{{{5}}}}}|{{b|{{{5}}}|text=y}}]]''}}<!--
-->{{#if:{{{2|}}}|{{#if:{{{3|}}}|}}<br>''[[{{b|{{{2}}}}}|{{b|{{{2}}}|text=y}}]]''}}<!--
-->{{#if:{{{6|}}}|,{{#if:{{{7|}}}||&nbsp;and}} ''[[{{b|{{{6}}}}}|{{b|{{{6}}}|text=y}}]]''}}<!--
-->{{#if:{{{3|}}}|{{#if:{{{4|}}}||}}<br>''[[{{b|{{{3}}}}}|{{b|{{{3}}}|text=y}}]]''}}<!--
-->{{#if:{{{7|}}}|, and ''[[{{b|{{{7}}}}}|{{b|{{{7}}}|text=y}}]]''}}<!--
-->{{#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|}}}|&nbsp;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|}}}|&nbsp;Proceed with caution if you have not read {{#if:{{{2|}}}|these books|this book}}.}}
|align={{{align|left}}}
|width={{{width|}}}
|dismiss={{{dismiss|}}}
}}<!--
}}<!--


-->[[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]].


== Usage ==
== Usage ==
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.{{spoiler|q}}
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]].
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
 
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
 
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
 
Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.
 


{| 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><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
!You Get
|-
| style="text-align: center;" |<pre>{{spoiler}}</pre>
|{{spoiler|width=83%|align=center}}
|-
! 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
!You Get
|-
| 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 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
!You Get
|-
| style="text-align: center;" |<pre>{{spoiler|tbot|tq}}</pre>
|{{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%}}
|}


== Articles Using Template ==
== Articles Using Template ==