Template:Expand/doc: Difference between revisions
Jump to navigation
Jump to search
(Now supports indent as usual. Thanks, Max!) |
mNo edit summary |
||
Line 7: | Line 7: | ||
{{inline note|bold=0|name={{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.}} | ||
{{inline note|bold=0|name={{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.}} | ||
{{inline note|bold=0|name={{param|titlestyle}}|Adds extra title style parameters.}} | |||
{{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!}}}} | {{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!}}}} | ||
{{inline note|bold=0|name={{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.}} | ||
{{inline note|bold=0|name={{param|startcollapsed}}|If set to 0, the content will initially be visible, otherwise collapsed. Default is 1.}} | {{inline note|bold=0|name={{param|startcollapsed}}|If set to 0, the content will initially be visible, otherwise collapsed. Default is 1.}} | ||
{{inline note|bold=0|name={{param|style}}| | {{inline note|bold=0|name={{param|style}}|Adds style parameters for the table that this template is based on.}} | ||
{{inline note|bold=0|name={{param|styleoverride}}|Overrides ALL table style parameters. Not recommended unless you know what you are doing! Using this ''can'' break the template!}} | |||
{{inline note|bold=0|name={{param|titlestyleoverride}}|Overrides ALL title style parameters. Not recommended unless you know what you are doing! Using this ''can'' break the title!}} | |||
=== Examples === | === Examples === | ||
<code><nowiki>{{expand|{{:Main Page}}}}</nowiki></code> renders as follows. | <code><nowiki>{{expand|{{:Main Page/{{uselang}}}}}}</nowiki></code> renders as follows. | ||
{{expand|{{:Main Page}}}} | {{expand|{{:Main Page/{{uselang}}}}}} | ||
<code><nowiki>{{expand|{{:Main Page}}|noborder=1}}</nowiki></code> renders as follows. | <code><nowiki>{{expand|{{:Main Page/{{uselang}}}}|noborder=1}}</nowiki></code> renders as follows. | ||
{{expand|{{:Main Page}}|noborder=1}} | {{expand|{{:Main Page/{{uselang}}}}|noborder=1}} | ||
Revision as of 22:21, 28 August 2023

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.
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: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|{{:Main Page/{{uselang}}}}}}
renders as follows.
{{:Main Page/Template:Uselang}} |
{{expand|{{:Main Page/{{uselang}}}}|noborder=1}}
renders as follows.
{{:Main Page/Template:Uselang}} |
{{expand|color=yellow|title=Yellow|Yellow!}}
renders as follows.
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. }}
The title alignment also uses {{{float}}} so that the button stays at the same position when toggling. |
See how this renders on the right.