Template:ExpandBox/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Category:Layout Container)
m (→‎top: clean up, replaced: {{Documentation subpage → {{Doc/subpage)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Doc/subpage}}
<!-- Please place categories where indicated at the bottom of this page.) -->
<!-- Please place categories where indicated at the bottom of this page. -->
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.)
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 ===
=== Parameters ===
* {{param|1}} - The text that should be collapsed initially.
* {{param|1}} - The content that should be collapsible.
* {{param|2}} - The title of the ExpandBox.
* {{param|title}} - The headline text of the ExpandBox.
* {{param|side}} - Where this ExpandBox should float. Default is "left".
* {{param|side}} - Where this ExpandBox should float, i.e. "left" or "right". Does not float by default. If it floats, one can use {{tl2|clr}} to clear vertical space.
* {{param|expandtext}} - The text that must be clicked to show {{param|1}}. Default is "Expand".
* {{param|expandtext}} - The text that must be clicked to show {{param|1}}. Default is "Expand".
* {{param|collapsetext}} - The text that must be clicked to hide {{param|1}}. Default is "Collapse".
* {{param|collapsetext}} - The text that must be clicked to hide {{param|1}}. Default is "Collapse".
* {{param|noendlinebreak}} - Set to 1 to have subsequent text float around this ExpandBox.
* {{param|startcollapsed}} - If set to 0, the content is initially visible, otherwise collapsed. Default is 1.
* {{param|style}} - Additional style parameters for the outer &lt;div>.


=== Examples ===
=== Examples ===
{| class="standard-table" style="width:100%;"
{| class="standard-table" style="width:100%;"
! style="width:50%;" | Wikitext
! style=width:50%| Wikitext
! style="width:50%;" | Result
! style=width:50%| Result
|-
|-
| <pre>Previous text.
| {{pre|Previous text.
{{ExpandBox |
{{ExpandBox {{!}}
* Sample
* Sample
* Enumeration
* Enumeration
Line 23: Line 24:
* Hiding
* Hiding
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox |
{{ExpandBox |
Line 33: Line 34:
Subsequent text.
Subsequent text.
|-
|-
| <pre>Previous text.
| {{pre|Previous text.
{{ExpandBox | noendlinebreak=1 |
{{ExpandBox
&#124;startcollapsed{{=}}0
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
Line 40: Line 43:
* Hiding
* Hiding
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox | noendlinebreak=1 |
{{ExpandBox
|startcollapsed=0
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 50: Line 55:
Subsequent text.
Subsequent text.
|-
|-
| <pre>Previous text.
| {{pre|Previous text.
{{ExpandBox | expandtext=Show | collapsetext=Hide |
{{ExpandBox
&#124;expandtext{{=}}Show
&#124;collapsetext{{=}}Hide
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
Line 57: Line 65:
* Hiding
* Hiding
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox | expandtext=Show | collapsetext=Hide |
{{ExpandBox
|expandtext=Show
|collapsetext=Hide
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 67: Line 78:
Subsequent text.
Subsequent text.
|-
|-
| <pre>Previous text.
| {{pre|Previous text.
{{ExpandBox | side=right |
{{ExpandBox
&#124;side{{=}}right
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
Line 74: Line 87:
* Hiding
* Hiding
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox | side=right |
{{ExpandBox
|side=right
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 84: Line 99:
Subsequent text.
Subsequent text.
|-
|-
| <pre>Previous text.
| {{pre|Previous text.
{{ExpandBox |
{{ExpandBox
&#124;title{{=}}Example for an ExpandBox
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
* Worth
* Worth
* Hiding
* Hiding
| Example for an ExpandBox
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox |
{{ExpandBox
|title=Example for an ExpandBox
|
* Sample
* Sample
* Enumeration
* Enumeration
* Worth
* Worth
* Hiding
* Hiding
| Example for an ExpandBox
}}
}}
Subsequent text.
Subsequent text.

Latest revision as of 02:15, 12 January 2024

Edit-copy.png
This is a documentation subpage for Template:ExpandBox.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

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.

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

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

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

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

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

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

  • Sample
  • Enumeration
  • Worth
  • Hiding

Subsequent text.

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

Subsequent text.