Difference between revisions of "Template:Switcher"
(Created page with "<div class="switcher-container"><noinclude><!-- --></noinclude>{{safesubst<noinclude />:#if:{{{2|}}}|<div>{{{1|}}}<span class="switcher-label" style="display:none" {{safesubst...") |
|||
Line 1: | Line 1: | ||
− | <div class="switcher-container" | + | <includeonly><div class="switcher-container">{{ |
− | + | safesubst:#if:{{{2|}}}|<div>{{{1|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|1|data-switcher-default=""}}>{{safesubst:#if:trim|{{{2|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{4|}}}|<div>{{{3|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|2|data-switcher-default=""}}>{{safesubst:#if:trim|{{{4|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{6|}}}|<div>{{{5|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|3|data-switcher-default=""}}>{{safesubst:#if:trim|{{{6|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{8|}}}|<div>{{{7|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|4|data-switcher-default=""}}>{{safesubst:#if:trim|{{{8|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{10|}}}|<div>{{{9|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|5|data-switcher-default=""}}>{{safesubst:#if:trim|{{{10|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{12|}}}|<div>{{{11|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|6|data-switcher-default=""}}>{{safesubst:#if:trim|{{{12|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{14|}}}|<div>{{{13|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|7|data-switcher-default=""}}>{{safesubst:#if:trim|{{{14|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{16|}}}|<div>{{{15|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|8|data-switcher-default=""}}>{{safesubst:#if:trim|{{{16|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{18|}}}|<div>{{{17|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|9|data-switcher-default=""}}>{{safesubst:#if:trim|{{{18|}}}}}</span></div>}}{{ | |
− | + | safesubst:#if:{{{20|}}}|<div>{{{19|}}}<span class="switcher-label" style="display:none" {{ | |
− | + | safesubst:#ifeq:{{{default|}}}|10|data-switcher-default=""}}>{{safesubst:#if:trim|{{{20|}}}}}</span></div>}}{{ | |
− | --> | + | safesubst:#if:{{{22|}}}|<div>{{{21|}}}<span class="switcher-label" style="display:none" {{ |
− | {{Documentation}} | + | safesubst:#ifeq:{{{default|}}}|11|data-switcher-default=""}}>{{safesubst:#if:trim|{{{22|}}}}}</span></div>}}{{ |
− | </noinclude> | + | safesubst:#if:{{{24|}}}|<div>{{{23|}}}<span class="switcher-label" style="display:none" {{ |
+ | safesubst:#ifeq:{{{default|}}}|12|data-switcher-default=""}}>{{safesubst:#if:trim|{{{24|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{26|}}}|<div>{{{25|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|13|data-switcher-default=""}}>{{safesubst:#if:trim|{{{26|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{28|}}}|<div>{{{27|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|14|data-switcher-default=""}}>{{safesubst:#if:trim|{{{28|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{30|}}}|<div>{{{29|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|15|data-switcher-default=""}}>{{safesubst:#if:trim|{{{30|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{32|}}}|<div>{{{31|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|16|data-switcher-default=""}}>{{safesubst:#if:trim|{{{32|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{34|}}}|<div>{{{33|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|17|data-switcher-default=""}}>{{safesubst:#if:trim|{{{34|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{36|}}}|<div>{{{35|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|18|data-switcher-default=""}}>{{safesubst:#if:trim|{{{36|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{38|}}}|<div>{{{37|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|19|data-switcher-default=""}}>{{safesubst:#if:trim|{{{38|}}}}}</span></div>}}{{ | ||
+ | safesubst:#if:{{{40|}}}|<div>{{{39|}}}<span class="switcher-label" style="display:none" {{ | ||
+ | safesubst:#ifeq:{{{default|}}}|20|data-switcher-default=""}}>{{safesubst:#if:trim|{{{40|}}}}}</span></div>}}</div></includeonly><noinclude><!-- | ||
+ | |||
+ | NOTES | ||
+ | The includeonly tags prevent the safesubst from substituting. | ||
+ | #if:trim is the same as trim but lowers the post-expand include size. | ||
+ | |||
+ | -->{{Documentation}}</noinclude> |
Revision as of 14:48, 11 June 2023
This template is used to create a switchable image with caption, for use in infoboxes. Note that this template does not work in the editing preview.
Parameters
Odd numbered parameters provide the image in wikitext; even numbered parameters provide the captions. Up to 20 images are supported.
Example
{{Switcher
| [[File:Example.png|300px]]
| An example
| [[File:Example image not to be used in article namespace.jpg|300px]]
| A different example
}}
Output:
TemplateData
<templatedata> { "params": { "1": { "description": "Image 1 wikitext", "example": "", "type": "unbalanced-wikitext" }, "2": { "description": "Image 1 caption", "example": "This is just an example.", "type": "string" }, "3": { "description": "See {{{1}}} (recursive)", "type": "unbalanced-wikitext" }, "4": { "description": "See {{{2}}} (recursive)", "type": "string" } }, "description": "Creates a switchable image with caption for use in infoboxes" } </templatedata>