Template:ExpandBox/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Added example text before and after each ExpandBox to visualize text alignment and split starterlinebreak and noendlinebreak into two examples.)
m (→‎top: clean up, replaced: {{Documentation subpage → {{Doc/subpage)
 
(3 intermediate revisions by 2 users 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 ===
* {{param|1}} - The content that should be collapsible.
* {{param|title}} - The headline text of the ExpandBox.
* {{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|collapsetext}} - The text that must be clicked to hide {{param|1}}. Default is "Collapse".
* {{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 ===
{| class="standard-table" style="width:100%;"
{| class="standard-table" style="width:100%;"
|+ Example usage
! style=width:50%| Wikitext
! Parameter
! style=width:50%| Result
! style="width:42%;" | Wikitext
! style="width:42%;" | Result
|-
|-
| None
| {{pre|Previous text.
| <pre>Previous text.
{{ExpandBox {{!}}
{{ExpandBox |
* Sample
* Sample
* Enumeration
* Enumeration
Line 16: Line 24:
* Hiding
* Hiding
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox |
{{ExpandBox |
Line 26: Line 34:
Subsequent text.
Subsequent text.
|-
|-
| <code>starterlinebreak</code>
| {{pre|Previous text.
| <pre>Previous text.
{{ExpandBox
{{ExpandBox | starterlinebreak=1 |
&#124;startcollapsed{{=}}0
* Sample
&#124;
* Enumeration
* Worth
* Hiding
}}
Subsequent text.</pre>{{Note | <code>starterlinebreak</code> can be replaced with <code>startinglinebreak</code>.}}
| Previous text.
{{ExpandBox | starterlinebreak=1 |
* Sample
* Enumeration
* Worth
* Hiding
}}
Subsequent text.
|-
| <code>noendlinebreak</code>
| <pre>Previous text.
{{ExpandBox | noendlinebreak=1 |
* Sample
* Sample
* Enumeration
* Enumeration
Line 52: Line 43:
* Hiding
* Hiding
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox | noendlinebreak=1 |  
{{ExpandBox
|startcollapsed=0
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 62: Line 55:
Subsequent text.
Subsequent text.
|-
|-
| <code>expandtext</code><br><code>collapsetext</code>
| {{pre|Previous text.
| <pre>Previous text.
{{ExpandBox
{{ExpandBox | expandtext=Show | collapsetext=Hide |
&#124;expandtext{{=}}Show
&#124;collapsetext{{=}}Hide
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
Line 70: 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 80: Line 78:
Subsequent text.
Subsequent text.
|-
|-
| <code>side</code>
| {{pre|Previous text.
| <pre>Previous text.
{{ExpandBox
{{ExpandBox | side=right |
&#124;side{{=}}right
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
Line 88: Line 87:
* Hiding
* Hiding
}}
}}
Subsequent text.</pre>
Subsequent text.}}
| Previous text.
| Previous text.
{{ExpandBox | side=right |
{{ExpandBox
|side=right
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 98: Line 99:
Subsequent text.
Subsequent text.
|-
|-
| The second unnamed parameter is the title.
| {{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.
Line 120: Line 122:


<includeonly>
<includeonly>
<!--{{otherlang2
|title=
}}-->
{{sandbox other||
{{sandbox other||
[[Category:Layout Container]]
<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
}}</includeonly>
}}</includeonly>

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.