Template:Synced switch/doc

From RuneSaga Wiki
Revision as of 00:32, 25 April 2024 by Plz2 (talk | contribs) (Created page with "{{Documentation}} {{invokes|Synced switch}} '''Synced switch''' is a method to have content change at the same time as a switch infobox, without generating the associated buttons. ==Usage== <pre>{{Synced switch|version1=content shown for variant 1|version2=content shown for variant 2|default=content shown for all other variants}}</pre> This usage requires a Module:Infobox-based switch infobox to be on the page, as the setup for switching that infobox completes the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Lua error in package.lua at line 80: module 'Module:DPLlua' not found. Template:Invokes 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.