Template:ExpandBox/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(/doc version of ExpandBox template)
 
m (→‎top: clean up, replaced: {{Documentation subpage → {{Doc/subpage)
 
(8 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
! style="width:50%;" | Wikitext
! style=width:50%| Result
! style="width:50%;" | Result
|-
|-
| <pre>{{ExpandBox |
| {{pre|Previous text.
{{ExpandBox {{!}}
* Sample
* Sample
* Enumeration
* Enumeration
* Worth
* Worth
* Hiding
* Hiding
}}</pre>
}}
| {{ExpandBox |
Subsequent text.}}
| Previous text.
{{ExpandBox |
* Sample
* Sample
* Enumeration
* Enumeration
Line 19: Line 32:
* Hiding
* Hiding
}}
}}
Subsequent text.
|-
|-
| <pre>{{ExpandBox | nostarterlinebreak=1 | noendlinebreak=1
| {{pre|Previous text.
{{ExpandBox
&#124;startcollapsed{{=}}0
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
* Worth
* Worth
* Hiding
* Hiding
}}</pre>
}}
| {{ExpandBox | nostarterlinebreak=1 | noendlinebreak = 1
Subsequent text.}}
| Previous text.
{{ExpandBox
|startcollapsed=0
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 32: Line 53:
* Hiding
* Hiding
}}
}}
Subsequent text.
|-
|-
| <pre>{{ExpandBox | expandtext=Show | collapsetext=Hide |
| {{pre|Previous text.
{{ExpandBox
&#124;expandtext{{=}}Show
&#124;collapsetext{{=}}Hide
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
* Wortha
* Worth
* Hiding
* Hiding
}}</pre>
}}
| {{ExpandBox | expandtext=Show | collapsetext=Hide |
Subsequent text.}}
| Previous text.
{{ExpandBox
|expandtext=Show
|collapsetext=Hide
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 45: Line 76:
* Hiding
* Hiding
}}
}}
Subsequent text.
|-
|-
| <pre>{{ExpandBox | side=right |
| {{pre|Previous text.
{{ExpandBox
&#124;side{{=}}right
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
* Worth
* Worth
* Hiding
* Hiding
}}</pre>
}}
| {{ExpandBox | side=right |
Subsequent text.}}
| Previous text.
{{ExpandBox
|side=right
|
* Sample
* Sample
* Enumeration
* Enumeration
Line 58: Line 97:
* Hiding
* Hiding
}}
}}
Subsequent text.
|-
|-
| <pre>{{ExpandBox |
| {{pre|Previous text.
{{ExpandBox
&#124;title{{=}}Example for an ExpandBox
&#124;
* Sample
* Sample
* Enumeration
* Enumeration
* Worth
* Worth
* Hiding
* Hiding
| Example for an ExpandBox
}}
}}</pre>
Subsequent text.}}
| {{ExpandBox |
| Previous text.
{{ExpandBox
|title=Example for an ExpandBox
|
* Sample
* Sample
* Enumeration
* Enumeration
* Worth
* Worth
* Hiding
* Hiding
| Example for an ExpandBox
}}
}}
Subsequent text.
|}
|}


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