Home
Random
Log in
Settings
About Brighter Shores Wiki
Disclaimers
Search
Editing
Template:Switch infobox/doc
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{documentation}} '''Template:Switch infobox''' is used to display infoboxes of the same type on a single page, as opposed to [[Template:Multi infobox]], which displays infoboxes of different types on a single page. It is typically used to separate versions of the subject with different conditions (for example, an NPC's state/appearance before and after a quest). In the Brighter Shores wiki, this function is built into [[Module:Infobox]] as the <code>versions</code> options, so any infoboxes which are built from that base should use the native switch behaviour. This template should only be used for template boxes that are not built on the base of [[Module:Infobox]]. After the insertion of the template, there will be different buttons stating the possible conditions of that page. When clicked on different conditions, the page will display different information. Note that switch infoboxes can have unintended interactions with other switch infoboxes, or with other infoboxes that contain multiple versions. You can specify your own switch_id's to mitigate this interaction (see [[#Specifying switch IDs]] below). ==Usage== <pre> {{Switch infobox |text1 = Name of condition 1 |item1 = Type information here which is shown in condition 1 |text2 = Name of condition 2 |item2 = Type information here which is shown in condition 2 |text3 = Name of condition 3 |item3 = Type information here which is shown in condition 3 }} </pre> produces {{Switch infobox |text1 = Name of condition 1 |item1 = Type information here which is shown in condition 1 |text2 = Name of condition 2 |item2 = Type information here which is shown in condition 2 |text3 = Name of condition 3 |item3 = Type information here which is shown in condition 3 }} ===Specifying switch IDs=== By default, each switch item uses an ID of 1, 2, 3, etc. Because all switch infoboxes and multi-version infoboxes use the same numerical ID by default, they all switch at the same time, which is often not intended. To avoid this issue, you can manually specify the ID for each item with the <code>switch_id#</code>, where <code>#</code> is the item number. These switch IDs can be specified to avoid conflicts with other switch infoboxes or multi-version infoboxes. The rules for specifying <code>switch_id</code> are: * <code>switch_id</code> can be text, including most special characters (although it's probably a good idea to keep it simple) * <code>switch_id</code> must '''not''' contain double-quotes (") * Do '''NOT''' use the same <code>switch_id</code> for multiple items in the same switch infobox. This causes both items to be shown when clicked and duplicates the switch buttons. Example usage: <pre> {{Switch infobox |text1 = 1: My switch ID is alt1 |switch_id1 = alt1 |item1 = Item 1: Note that this does not interact with the other example on this page. |text2 = 2: My switch ID is alt2 |switch_id2 = alt2 |item2 = Item2: Note that this does not interact with the other example on this page. }} </pre> produces {{Switch infobox |text1 = 1: My switch ID is alt1 |switch_id1 = alt1 |item1 = Item 1: Note that this does not interact with the other example on this page. |text2 = 2: My switch ID is alt2 |switch_id2 = alt2 |item2 = Item2: Note that this does not interact with the other example on this page. }} ==Quick copy== ''Note: The template is not limited to 2 conditions only. Editors can add more conditions if available.'' <pre> {{Switch infobox |text1 = |item1 = |text2 = |item2 = }} </pre> ==See also== * [[Template:Multi infobox]] * [[Module:Infobox#Special params]] {{TemplateData|<templatedata> { "description": "Used to separate different information on a specific page with different conditions.", "params": { "text1": { "label": "Title #1", "description": "Name of condition", "required": true, "type": "line" }, "switch_id1": { "label": "ID #1", "description": "Switch ID for condition #1; see full template docs", "type": "line" }, "item1": { "label": "Item #1", "required": true, "description": "Information (e.g. an infobox) shown for the corresponding condition", "type": "content" }, "text2": { "label": "Title #2", "inherits": "text1" }, "switch_id2": { "label": "ID #2", "description": "Switch ID for condition #2; see full template docs", "type": "line" }, "item2": { "label": "Item #2", "inherits": "item1" }, "text3": { "label": "Title #3", "description": "Name of condition", "type": "line" }, "switch_id3": { "label": "ID #3", "description": "Switch ID for condition #3; see full template docs", "type": "line" }, "item3": { "label": "Item #3", "description": "Information (e.g. an infobox) shown for the corresponding condition", "type": "content" }, "text4": { "label": "Title #4", "inherits": "text3" }, "switch_id4": { "label": "ID #4", "description": "Switch ID for condition #4; see full template docs", "type": "line" }, "item4": { "label": "Item #4", "inherits": "item3" }, "text5": { "label": "Title #5", "inherits": "text3" }, "switch_id5": { "label": "ID #5", "description": "Switch ID for condition #5; see full template docs", "type": "line" }, "item5": { "label": "Item #5", "inherits": "item3" }, "text6": { "label": "Title #6", "inherits": "text3" }, "switch_id6": { "label": "ID #6", "description": "Switch ID for condition #6; see full template docs", "type": "line" }, "item6": { "label": "Item #6", "inherits": "item3" }, "text7": { "label": "Title #7", "inherits": "text3" }, "switch_id7": { "label": "ID #7", "description": "Switch ID for condition #7; see full template docs", "type": "line" }, "item7": { "label": "Item #7", "inherits": "item3" }, "text8": { "label": "Title #8", "inherits": "text3" }, "switch_id8": { "label": "ID #8", "description": "Switch ID for condition #8; see full template docs", "type": "line" }, "item8": { "label": "Item #8", "inherits": "item3" }, "text9": { "label": "Title #9", "inherits": "text3" }, "switch_id9": { "label": "ID #9", "description": "Switch ID for condition #9; see full template docs", "type": "line" }, "item9": { "label": "Item #9", "inherits": "item3" }, "text10": { "label": "Title #10", "inherits": "text3" }, "switch_id10": { "label": "ID #10", "description": "Switch ID for condition #10; see full template docs", "type": "line" }, "item10": { "label": "Item #10", "inherits": "item3" } }, "paramOrder": [ "text1", "switch_id1", "item1", "text2", "switch_id2", "item2", "text3", "switch_id3", "item3", "text4", "switch_id4", "item4", "text5", "switch_id5", "item5", "text6", "switch_id6", "item6", "text7", "switch_id7", "item7", "text8", "switch_id8", "item8", "text9", "switch_id9", "item9", "text10", "switch_id10", "item10" ], "format": "\n{{_\n|_ = _\n}}\n" }</templatedata>}} <includeonly>[[Category:Infobox templates|{{PAGENAME}}]] [[Category:Formatting templates]]</includeonly>
Summary:
Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see
Brighter Shores:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Templates used on this page:
Template:Documentation
(
edit
)
Template:Switch infobox
(
edit
)
Template:TemplateData
(
edit
)
Module:Array
(
edit
)
Module:DPLlua
(
edit
)
Module:DependencyList
(
edit
)
Module:Documentation
(
edit
)
Module:Paramtest
(
edit
)
Module:Switch infobox
(
edit
)
Module:Tooltip
(
edit
)
Module:Yesno
(
view source
) (semi-protected)
This page is a member of a hidden category:
Category:Templates using TemplateData