Currently there may be errors shown on top of a page, because of a missing Wiki update (PHP version and extension DPL3).
Navigation
Topics Help • Register • News • History • How to • Sequences statistics • Template prototypes

Difference between revisions of "Template:Spoiler"

From Prime-Wiki
Jump to: navigation, search
(new)
 
(template data for copy)
 
Line 27: Line 27:
 
Example with all parameters:
 
Example with all parameters:
 
<pre>
 
<pre>
{{Spoiler|title=Test parameters|content=The test text.|width=60%|margin=5em|border-w=5px|border-s=dotted|border-c=#f0f|background-c=#0f0|header-a=left|header-c=#999|header-fs=130%|header-fc=#fff|align=center|font-s=150%|show=block}}
+
{{Spoiler|title=Test parameters|content=The test text.|width=60%|margin=5em|border-w=5px|border-t=dotted|border-c=#f0f|background-c=#0f0|header-a=left|header-c=#999|header-fs=130%|header-fc=#fff|align=center|font-s=150%|show=block}}
 +
</pre>
 +
{{Spoiler|title=Test parameters|content=The test text.|width=60%|margin=5em|border-w=5px|border-t=dotted|border-c=#f0f|background-c=#0f0|header-a=left|header-c=#999|header-fs=130%|header-fc=#fff|align=center|font-s=150%|show=block}}
 +
 
 +
<pre>
 +
{{Spoiler
 +
|title=
 +
|content=
 +
|width=
 +
|margin=
 +
|border-w=
 +
|border-t=
 +
|border-c=
 +
|background-c=
 +
|header-a=
 +
|header-c=
 +
|header-fs=
 +
|header-fc=
 +
|align=
 +
|font-s=
 +
|show=
 +
}}
 
</pre>
 
</pre>
{{Spoiler|title=Test parameters|content=The test text.|width=60%|margin=5em|border-w=5px|border-s=dotted|border-c=#f0f|background-c=#0f0|header-a=left|header-c=#999|header-fs=130%|header-fc=#fff|align=center|font-s=150%|show=block}}
 
 
[[Category:Templates‎]]</noinclude>
 
[[Category:Templates‎]]</noinclude>
<includeonly><div class="mw-collapsible {{{show|mw-collapsed}}}" style="width:{{{width|100%}}}; margin:{{{margin|auto}}}; clear:{{{clear|both}}}; padding:1px; border:{{{border-c|black}}} {{{border-w|1px}}} {{{border-t|solid}}}; background:{{{background-c|white}}};"> <div style="padding-left:{{#ifeq:{{{header-align}}}|center|6.4|1}}em; padding-right:.4em; text-align:{{{header-a|center}}}; background-color:{{{header-c|#f0f2f5}}}; font-size:{{{header-fs|{{{font-size|100%}}}}}}; color:{{{header-fc|#000000}}};">{{{title|}}}</div><div class="mw-collapsible-content" style="text-align:{{{align|left}}}; padding-top:2px; padding-bottom:2px; padding-left:0em; font-size:{{{font-s|100%}}};">
+
<includeonly><div class="mw-collapsible {{{show|mw-collapsed}}}" style="width:{{{width|100%}}}; margin:{{{margin|auto}}}; clear:both; padding:1px; border:{{{border-c|black}}} {{{border-w|1px}}} {{{border-t|solid}}}; background:{{{background-c|white}}};"> <div style="padding-left:{{#ifeq:{{{header-a}}}|center|6.4|1}}em; padding-right:.4em; text-align:{{{header-a|center}}}; background-color:{{{header-c|#f0f2f5}}}; font-size:{{{header-fs|100%}}}; color:{{{header-fc|#000000}}};">{{{title|}}}</div><div class="mw-collapsible-content" style="text-align:{{{align|left}}}; padding-top:2px; padding-bottom:2px; padding-left:0em; font-size:{{{font-s|100%}}};">
 
{{{content}}}</div></div></includeonly>
 
{{{content}}}</div></div></includeonly>

Latest revision as of 20:45, 9 February 2019

Display a spoilers to show/hide text.

Example: (parameter 'title' and 'content' recommended):

{{Spoiler|title=This is a test.|content=Text here 
Link: [[Main Page]]}}
This is a test.

Text here

Link: Main Page

All parametere:

  • width: default 100%
  • margin: default auto
  • border-w: border width, default 1px
  • border-t: border type, default solid
  • border-c: border color, default black
  • background-c: background color, default white
  • header-a: header align, default center
  • header-c: background color header, default #f0f2f5)
  • header-fs: font size header, default 100%
  • header-fc: font color header, default black
  • align: alignment header, default left
  • font-s: font size content, default 100%
  • show: hide/show, none/block

Example with all parameters:

{{Spoiler|title=Test parameters|content=The test text.|width=60%|margin=5em|border-w=5px|border-t=dotted|border-c=#f0f|background-c=#0f0|header-a=left|header-c=#999|header-fs=130%|header-fc=#fff|align=center|font-s=150%|show=block}}
Test parameters
The test text.
{{Spoiler
|title=
|content=
|width=
|margin=
|border-w=
|border-t=
|border-c=
|background-c=
|header-a=
|header-c=
|header-fs=
|header-fc=
|align=
|font-s=
|show=
}}