Template:Expand: Difference between revisions

From Nottinghack Wiki
Jump to navigation Jump to search
No edit summary
:Default show mode is to hide whatever is past to hidden, to show expanded use 'expanded=yes'.
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div {{#switch: lc:{{{expanded}}}|yes=class="mw-collapsible"|#default=class="mw-collapsible mw-collapsed"> }} {{{nohide}}}
{{#switch: {{lc:{{{expanded}}} }}
<div class="mw-collapsible-content">{{{1|{{{hide|}}} }}}</div>
|yes=<div class="mw-collapsible">
|#default=<div class="mw-collapsible mw-collapsed">
}}<!--
-->{{#if: {{{nohide|}}}|{{{nohide}}} }}<!--
--><div class="mw-collapsible-content">{{{1|{{{hide}}} }}}</div>
</div><noinclude>
</div><noinclude>
 
{{clear}}
==Documentation==
==Documentation==
Makes part of page hidden and expandable.
Makes part of page hidden and expandable.


===Examples===
===Examples===
Simple no parameters.
Simple.
 
:<code><nowiki>{{expand|This is hidden by default.}}</nowiki></code>
:<code><nowiki>{{expand|This is hidden.}}</nowiki></code>
 
:{{expand|This is hidden.}}


Expanded with parameters.
Expanded with parameters.


:<code><nowiki>{{expand|This is hidden.|nohide=This can be.|expanded=yes}}</nowiki></code>
:<code><nowiki>{{expand|This can be hidden.|nohide=This is not hidden.|expanded=yes}}</nowiki></code>
 
:{{expand|This is hidden.|nohide=This can be.|expanded=yes}}


===Parameters===
===Parameters===
Line 23: Line 22:
:Part of page to hide. Also works as first parameter unnamed.
:Part of page to hide. Also works as first parameter unnamed.
;nohide
;nohide
:Part of page not hidden (goes first, good for titles).
:Part of page not hidden (unhidden part appears before the hidden; good for titles).
;expanded
;expanded
:Defaults to hidden, to default to expanded use 'expanded=yes'
:Default show mode is to hide whatever is past to hidden, to show expanded use 'expanded=yes'.


[[Category:Utility Templates]]
[[Category:Utility Templates]]
</noinclude>
</noinclude>

Latest revision as of 12:43, 27 February 2019

{{{hide}}}

Documentation

Makes part of page hidden and expandable.

Examples

Simple.

{{expand|This is hidden by default.}}

Expanded with parameters.

{{expand|This can be hidden.|nohide=This is not hidden.|expanded=yes}}

Parameters

hide
Part of page to hide. Also works as first parameter unnamed.
nohide
Part of page not hidden (unhidden part appears before the hidden; good for titles).
expanded
Default show mode is to hide whatever is past to hidden, to show expanded use 'expanded=yes'.