1,924 bytes added
, 8 years ago
<includeonly>{{#if:{{{button|}}}|<div class="toggle" data-target="{{{target|default}}}" data-default="{{{default|hide}}}">
<span class="toggle-show" style="{{{show_style|cursor:pointer;color:#006cb0;}}}">☑ {{{show_text|Show details}}}</span>
<span class="toggle-hide" style="{{{hide_style|cursor:pointer;color:#006cb0;}}}">☒ {{{hide_text|Show details}}}</span>
</div>|{{#if:{{{1|}}}|<span class="toggle-target-{{{target|default}}}">{{{1|}}}</span>|class="toggle-target-{{{target|default}}}"}}}}</includeonly><noinclude>
This is a helper template for using [[MediaWiki:DetailToggle.js]].
==Examples==
===Default===
<pre>
{{Detail|button=true}}
{{Detail|Hidden content}}
</pre>
{{Detail|button=true}}
{{Detail|Hidden content}}
<pre>
===Custom property===
<pre>
{{Detail|button=true|target=example-1}}
{{Detail||target=example-1|Hidden content}}
</pre>
{{Detail|button=true|target=example-1}}
{{Detail|target=example-1|Hidden content}}
===Custom elements===
<pre>
{{Detail|button=true|target=example-2}}
<div {{Detail|target=example-2}}>Hidden content</div>
</pre>
{{Detail|button=true|target=example-2}}
<div {{Detail|target=example-2}}>Hidden content</div>
===Tables & custom text===
<pre>
{{Detail|button=true|target=example-row|show_text=Show row|hide_text=Show row (hidden)}}
{{Detail|button=true|target=example-column|show_text=Show column|hide_text=Show column (hidden)}}
{|
|Normal row
|...
|{{Detail|target=example-column}}|Hidden column
|- {{Detail|target=example-row}}
|Hidden row
|...
|{{Detail|target=example-column}}|Hidden column
|}
</pre>
{{Detail|button=true|target=example-row|show_text=Show row|hide_text=Show row (hidden)}}
{{Detail|button=true|target=example-column|show_text=Show column|hide_text=Show column (hidden)}}
{|
|Normal row
|...
|{{Detail|target=example-column}}|Hidden column
|- {{Detail|target=example-row}}
|Hidden row
|...
|{{Detail|target=example-column}}|Hidden column
|}
</noinclude>