Difference between revisions of "Template:Collapsible"

From HeRO Wiki
Jump to: navigation, search
(Created page with "<div class="mw-collapsible mw-collapsed" style="width:95%; margin-left: 2.5%; margin-right:2.5%;"> <div style="height:25px; background-color:#ECC788; vertical-align:middle; te...")
 
(added functionality to have a non-collapsed state and also improved documentation)
Line 1: Line 1:
<div class="mw-collapsible mw-collapsed" style="width:95%; margin-left: 2.5%; margin-right:2.5%;">
+
<includeonly>
 +
<div class="mw-collapsible {{t|1=|1{{{collapsed|}}}= mw-collapsed}}" style="width:95%; margin-left: 2.5%; margin-right:2.5%;">
 
<div style="height:25px; background-color:#ECC788; vertical-align:middle; text-align:center; font-size:120%;">{{{text|text}}}</div>
 
<div style="height:25px; background-color:#ECC788; vertical-align:middle; text-align:center; font-size:120%;">{{{text|text}}}</div>
 
<div class="mw-collapsible-content" style="padding:15px;">
 
<div class="mw-collapsible-content" style="padding:15px;">
 
{{{content|content}}}
 
{{{content|content}}}
 
</div></div>
 
</div></div>
 +
</includeonly>
 
<noinclude>
 
<noinclude>
 
==Usage==
 
==Usage==
This template is preferably used for long content that stretches the page.
+
This template is preferably used for long content that stretches the page. This template is collapsed by default.
  
<pre>
+
{| class=wikitable {{prettytable}}
{{collapsible
+
!Parameter
|text=
+
!Usage
|content=
+
|-
}}
+
| {{{text}}}
</pre>
+
| Any data input here is always shown regardless of whether it is collapsed or not. Defaults to show "text" when there is no input.
 +
'''Example''': <nowiki>{{collapsible|text=Hello}}</nowiki>
 +
{{collapsible|text=Hello}}
 +
 
 +
|-
 +
| {{{content}}}
 +
| Any data input here can be hidden when collapsed. Defaults to show "content" when there is no input.
 +
'''Example''': <nowiki>{{collapsible|content=Hello}}</nowiki>
 +
{{collapsible|content=Hello}}
 +
 
 +
|-
 +
| {{{collapsed}}}
 +
| Any data input here will cause it to not default to collapsed.
 +
'''Example''': <nowiki>{{collapsible|collapsed=}}</nowiki>
 +
{{collapsible|collapsed=}}
 +
|}
  
 
[[Category:Template]]
 
[[Category:Template]]
 
</noinclude>
 
</noinclude>

Revision as of 08:16, 20 October 2019


Usage

This template is preferably used for long content that stretches the page. This template is collapsed by default.

Parameter Usage
{{{text}}} Any data input here is always shown regardless of whether it is collapsed or not. Defaults to show "text" when there is no input.

Example: {{collapsible|text=Hello}}

Hello

content


{{{content}}} Any data input here can be hidden when collapsed. Defaults to show "content" when there is no input.

Example: {{collapsible|content=Hello}}

text

Hello


{{{collapsed}}} Any data input here will cause it to not default to collapsed.

Example: {{collapsible|collapsed=}}

text

content