Difference between revisions of "Template:ExpandBox"

From Valve Developer Community
Jump to: navigation, search
(Added expand and collpase text)
(Added examples.)
Line 1: Line 1:
<noinclude>This template is intended for very long lists that aren't significant enough to warrant their own page, but also end up making pages ridiculously long. Works fine even if used multiple times on a page. (Also, won't interfere with TOCs.) </noinclude>
+
<noinclude>
 +
This template is intended for very long lists that aren't significant enough to warrant their own page, but also end up making pages ridiculously long. Works fine even if used multiple times on a page. (Also, won't interfere with TOCs.)
 +
{| class="standard-table" style="width:100%;"
 +
|+ Example usage
 +
! style="width:50%;" | Wikitext
 +
! style="width:50%;" | Result
 +
|-
 +
| <pre>{{ExpandBox |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
}}</pre>
 +
| {{ExpandBox |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
}}
 +
|-
 +
| <pre>{{ExpandBox | expandtext=Show | collapsetext=Hide |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
}}</pre>
 +
| {{ExpandBox | expandtext=Show | collapsetext=Hide |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
}}
 +
|-
 +
| <pre>{{ExpandBox | side=right |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
}}</pre>
 +
| {{ExpandBox | side=right |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
}}
 +
|-
 +
| <pre>{{ExpandBox |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
| Example for an ExpandBox
 +
}}</pre>
 +
| {{ExpandBox |
 +
* Sample
 +
* Enumeration
 +
* Worth
 +
* Hiding
 +
| Example for an ExpandBox
 +
}}
 +
|}
 +
</noinclude><includeonly>
 
<div class="mw-collapsible mw-collapsed" data-expandtext="{{#If:{{{expandtext|}}}|{{{expandtext}}}|Expand}}" data-collapsetext="{{#If:{{{collapsetext|}}}|{{{collapsetext}}}|Collapse}}" style="border:1px grey solid; overflow:auto; float:{{#switch:{{lc:{{{side}}}}}
 
<div class="mw-collapsible mw-collapsed" data-expandtext="{{#If:{{{expandtext|}}}|{{{expandtext}}}|Expand}}" data-collapsetext="{{#If:{{{collapsetext|}}}|{{{collapsetext}}}|Collapse}}" style="border:1px grey solid; overflow:auto; float:{{#switch:{{lc:{{{side}}}}}
 
| left        = left
 
| left        = left
 
| right      = right
 
| right      = right
| #default    = left}}; display: inline-block;">{{#If:{{{2|}}}|'''{{{2}}}'''|}}<div class="mw-collapsible-content" style="display: none;"><div style="padding-right:6em;max-width:83em;">{{{1}}}</div></div></div>ᅠ
+
| #default    = left}}; display: inline-block;">{{#If:{{{2|}}}|'''{{{2}}}'''|}}<div class="mw-collapsible-content" style="display: none;"><div style="padding-right:6em;max-width:83em;">{{{1}}}</div></div></div>ᅠ</includeonly>
 
 

Revision as of 08:14, 18 April 2021

This template is intended for very long lists that aren't significant enough to warrant their own page, but also end up making pages ridiculously long. Works fine even if used multiple times on a page. (Also, won't interfere with TOCs.)

Example usage
Wikitext Result
{{ExpandBox |
* Sample
* Enumeration
* Worth
* Hiding
}}

{{ExpandBox | expandtext=Show | collapsetext=Hide |
* Sample
* Enumeration
* Worth
* Hiding
}}

{{ExpandBox | side=right |
* Sample
* Enumeration
* Worth
* Hiding
}}

{{ExpandBox |
* Sample
* Enumeration
* Worth
* Hiding
| Example for an ExpandBox
}}
Example for an ExpandBox