Template:Expand/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎top: clean up, replaced: {{Documentation subpage → {{Doc/subpage)
No edit summary
Line 16: Line 16:


=== Examples ===
=== Examples ===
<code><nowiki>{{expand|{{:Main Page/{{uselang}}}}}}</nowiki></code> renders as follows.
<code><nowiki>{{expand|{{MainPage}}}}</nowiki></code> renders as follows.
{{expand|{{:Main Page/{{uselang}}}}}}
{{expand|{{MainPage}}}}




<code><nowiki>{{expand|{{:Main Page/{{uselang}}}}|noborder=1}}</nowiki></code> renders as follows.
<code><nowiki>{{expand|{{MainPage}}|noborder=1}}</nowiki></code> renders as follows.
{{expand|{{:Main Page/{{uselang}}}}|noborder=1}}
{{expand|{{MainPage}}|noborder=1}}





Revision as of 06:11, 15 July 2024

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 content to expand or hide.
{{{float}}}Set to left or right if floating is desired.
{{{title}}}An optional title shown next to the expand button.
{{{titlestyle}}}Adds extra title style parameters.
{{{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.
{{{startcollapsed}}}If set to 0, the content will initially be visible, otherwise collapsed. Default is 1.
{{{style}}}Adds style parameters for the table that this template is based on.
{{{styleoverride}}}Overrides ALL table style parameters. Not recommended unless you know what you are doing! Using this can break the template!
{{{titlestyleoverride}}}Overrides ALL title style parameters. Not recommended unless you know what you are doing! Using this can break the title!

Examples

{{expand|{{MainPage}}}} renders as follows.

Welcome to the
Valve Developer Community
13,094 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|{{MainPage}}|noborder=1}} renders as follows.

Welcome to the
Valve Developer Community
13,094 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|Can be indented.}} renders as follows.

Can be indented.


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