Template:Citizenship-switch

From RPC Library
Revision as of 11:56, 5 February 2013 by Deirdre (talk | contribs)
Jump to navigation Jump to search
Warning! This template uses arcane features of template syntax, such as parser functions, or is particularly complex. Please don't edit it unless you know exactly what you're doing.

This template inserts a block of marked up text that depends on the value of its citizenship parameter. This allows you to display different text depending on the citizenship of a character, so long as that value is accessible by a template. This template exists to reduce error-prone, repetitive switch statements wherever this functionality is needed while simultaneously offering the ability to extend it automatically to new starting cities and to support new and creative misspellings of the starting cities' names.

Because of the limitations of template transclusion, if you need a pipe symbol in the blocks (say, if your block contains an Image tag), you should use Template:! instead of |.

Syntax

{{Citizenship-switch
| citizenship = The character's citizenship, which should be some reasonable facsimile of the starting city (Ul'dah, Gridania, or Limsa Lominsa). 
    The template will attempt to automagically handle misspellings.
| uldah_block = The block to display if citizenship is Ul'dah.
| gridania_block = The block to display if citizenship is Gridania.
| limsa_block = The block to display if citizenship is Limsa Lominsa.
| garlemald_block = The block to display if citizenship is Garlemald.
| ishgard_block = The block to display if citizenship is Ishgard.
| alamhigo_block = The block to display if citizenship is Ala Mhigo.
| default_block = (optional) The block to display if citizenship can't be reasonably matched to any of the above. 
    If this isn't included, a failure to match returns empty text.
}}

Copy-paste

{{Citizenship-switch
| citizenship = 
| uldah_block = 
| gridania_block = 
| limsa_block = 
| garlemald_block = 
| ishgard_block = 
| alamhigo_block = 
| default_block =
}}