This is a documentation subpage for Template:Synced switch.
It contains usage information, categories, and other content that is not part of the original template page.
Template:Synced switch invokes function main in Module:Synced switch using Lua.
Template:Synced switch invokes Module:Synced switch using Lua.

Synced switch is a method to have content change at the same time as a switch infobox, without generating the associated buttons.

Usage

{{Synced switch|version1=content shown for variant 1|version2=content shown for variant 2|default=content shown for all other variants}}

This usage requires a Module:Infobox-based switch infobox to be on the page, as the setup for switching that infobox completes the setup of the synced switch, by applying the button texts (or select option texts) used by the infobox to the div tags of the synced switch. If there are multiple Module:Infobox-based switches then it will use the first one as the setup.


If the page:

  • Has multiple Module:Infobox-based switches with differing button configurations
  • Has no Module:Infobox-based switches - only having Template:Switch infobox-based switches (including Template:Infobox Bonuses)
  • You wish to override the automatically applied button texts in order to match a different set of buttons

Then you will need to define the button texts manually by using corresponding text# parameters:

{{Synced switch|text1=button text 1|text2=button text 2|version1=content shown for variant 1|version2=content shown for variant 2|default=content shown for all other variants}}

Default does not require a button text.


In both uses, the synced switch will switch to a version whenever a button with the associated text is pressed somewhere on the page. This will generally be set by the version# parameters of Module:Infobox-based switches (and infoboxes with integrated switch infobox), or the text# parameters of Template:Switch infobox. If the item it tries to switch to doesn't exist, it will switch to the default version.