Template:ExpandBox: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Added space in the box title. Simplified code: {{#if: {{{1|}}} | {{{1}}} | str}} -> {{{1|str}}}. #switch is redundant in this case.)
(Replaced clear=all with clear={{{side}}}. Should make sense this way, revert if not.)
Line 1: Line 1:
{{lang|Template:ExpandBox}}<!--
{{lang|Template:ExpandBox}}
--><onlyinclude><includeonly><!-- double line break: (isn't there a better solution? this prevents indenting using :{{ExpandBox|...}} ) -->
<onlyinclude><includeonly><!-- double line break: (isn't there a better solution? this prevents indenting using :{{ExpandBox|...}} ) -->


<div class="mw-collapsible mw-collapsed" data-expandtext="{{{expandtext|Expand}}}" data-collapsetext="{{{collapsetext|Collapse}}}" style="border:1px grey solid; overflow:auto; float:{{{side|left}}}; display: inline-block;"><!--
<div class="mw-collapsible mw-collapsed" data-expandtext="{{{expandtext|Expand}}}" data-collapsetext="{{{collapsetext|Collapse}}}" style="border:1px grey solid; overflow:auto; float:{{{side|left}}}; display: inline-block;"><!--
Line 8: Line 8:
-->{{{1}}}<!--
-->{{{1}}}<!--
--></div></div></div><!--
--></div></div></div><!--
-->{{#if:{{{noendlinebreak|}}}||<br clear="all">}}<!--
-->{{#if:{{{noendlinebreak|}}}||<br clear="{{{side|left}}}">}}<!--


--></includeonly></onlyinclude>
--></includeonly></onlyinclude>
{{documentation}}
{{documentation}}
<!-- Add categories to the /doc subpage, not here -->
<!-- Add categories to the /doc subpage, not here -->

Revision as of 11:25, 14 December 2021


English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
View
Page history

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.)

Parameters

  • {{{1}}} - The content that should be collapsible.
  • {{{title}}} - The headline text of the ExpandBox.
  • {{{side}}} - Where this ExpandBox should float, i.e. "left" or "right". Does not float by default. If it floats, one can use {{clr}} to clear vertical space.
  • {{{expandtext}}} - The text that must be clicked to show {{{1}}}. Default is "Expand".
  • {{{collapsetext}}} - The text that must be clicked to hide {{{1}}}. Default is "Collapse".
  • {{{startcollapsed}}} - If set to 0, the content is initially visible, otherwise collapsed. Default is 1.
  • {{{style}}} - Additional style parameters for the outer <div>.

Examples

Wikitext Result
Previous text.
{{ExpandBox |
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.



Subsequent text.

Previous text.
{{ExpandBox
|startcollapsed=0
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.



Subsequent text.

Previous text.
{{ExpandBox
|expandtext=Show
|collapsetext=Hide
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.



Subsequent text.

Previous text.
{{ExpandBox
|side=right
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.



Subsequent text.

Previous text.
{{ExpandBox
|title=Example for an ExpandBox
|
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
Previous text.



Subsequent text.