Template:Expand/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created doc.)
 
m (Moved warning about {{{noborder}}}.)
Line 2: Line 2:
<!-- Please place categories where indicated at the bottom of this page.) -->
<!-- Please place categories where indicated at the bottom of this page.) -->
== Usage ==
== Usage ==
=== Parameters ===
=== Parameters ===
*{{param|1}} - The text to expand or hide.
{{inline note|bold=0|name={{param|1}}|The text to expand or hide.}}
*{{param|float}} - Set to <code>left</code> or <code>right</code> if floating is desired.
{{inline note|bold=0|name={{param|float}}|Set to <code>left</code> or <code>right</code> if floating is desired.}}
*{{param|title|}} - An optional title shown next to the expand button.
{{inline note|bold=0|name={{param|title}}|An optional title shown next to the expand button.}}
*{{param|noborder|0}} - If non-zero, use no border on the left.
{{inline note|bold=0|name={{param|noborder}}|If non-zero, use no border on the left. {{warning|It can become difficult to tell where the expanded text ends if the background colors are identical!}}}}
*{{param|color}} - The color of the left border and title, if used.
{{inline note|bold=0|name={{param|color}}|The color of the left border and title, if used.}}
*{{param|style|}} - Override style parameters for the table that this template is based on.
{{inline note|bold=0|name={{param|style}}|Override style parameters for the table that this template is based on.}}


=== Examples ===
=== Examples ===
Line 15: Line 16:




<code><nowiki>{{expand|{{:Main Page}}|noborder=1}}</nowiki></code> renders as follows. Note how difficult it is to tell where the expanded text ends.
<code><nowiki>{{expand|{{:Main Page}}|noborder=1}}</nowiki></code> renders as follows.
{{expand|{{:Main Page}}|noborder=1}}
{{expand|{{:Main Page}}|noborder=1}}



Revision as of 00:21, 27 January 2022

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

Usage

Parameters

{{{1}}}The text to expand or hide.
{{{float}}}Set to left or right if floating is desired.
{{{title}}}An optional title shown next to the expand button.
{{{noborder}}}If non-zero, use no border on the left.
Warning.pngWarning:It can become difficult to tell where the expanded text ends if the background colors are identical!
{{{color}}}The color of the left border and title, if used.
{{{style}}}Override style parameters for the table that this template is based on.

Examples

{{expand|{{:Main Page}}}} renders as follows.

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)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)
Welcome to the
Valve Developer Community
13,090 articles documenting the development process.

Whether you're building a commercial project or a modification for Half-Life® 2, you'll want to sign up as a Valve developer today. It's free to join and is open to anyone working with the Source engine and its software development kit.


{{expand|{{:Main Page}}|noborder=1}} renders as follows.

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)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)
Welcome to the
Valve Developer Community
13,090 articles documenting the development process.

Whether you're building a commercial project or a modification for Half-Life® 2, you'll want to sign up as a Valve developer today. It's free to join and is open to anyone working with the Source engine and its software development kit.


{{expand|color=yellow|title=Yellow|Yellow!}} renders as follows.

Yellow
Yellow!


{{expand|style=margin-left:2em|Artificial indent.}} renders as follows.

Artificial indent.


{{expand
|title=float{{=}}right
|float=right
|
The title alignment also uses {{param|float}} so that the button stays at the same position when toggling.
}}
float=right

The title alignment also uses {{{float}}} so that the button stays at the same position when toggling.

See how this renders on the right.