Difference between revisions of "Template:Citizenship-switch"

From RPC Library
Jump to navigation Jump to search
m (Protected "Template:Citizenship-switch": Counter-productive edit warring (‎[edit=sysop] (indefinite) ‎[move=sysop] (indefinite)))
(Add Doma block)
 
Line 1: Line 1:
<includeonly>{{#switch: {{lc:{{{citizenship}}}}} | ul'dah = {{{uldah_block}}} | uldah = {{{uldah_block}}} | ul'dahn = {{{uldah_block}}} | uldahn = {{{uldah_block}}} | gridania = {{{gridania_block}}} | gridanian = {{{gridania_block}}} | limsa = {{{limsa_block}}} | limsa lominsa = {{{limsa_block}}} | limsan = {{{limsa_block}}} | limsa lominsan = {{{limsa_block}}} | garlean = {{{garlemald_block}}} | imperial = {{{garlemald_block}}} | garlemald = {{{garlemald_block}}} |  ishgard = {{{ishgard_block}}} | ishgardian = {{{ishgard_block}}} | ala mhigo = {{{alamhigo_block}}} | ala mhigan = {{{alamhigo_block}}} | sharlayan = {{{sharlayan_block}}} | {{{default_block|}}} }}</includeonly><noinclude>
+
<includeonly>{{#switch: {{lc:{{{citizenship}}}}} | ul'dah = {{{uldah_block}}} | uldah = {{{uldah_block}}} | ul'dahn = {{{uldah_block}}} | uldahn = {{{uldah_block}}} | gridania = {{{gridania_block}}} | gridanian = {{{gridania_block}}} | limsa = {{{limsa_block}}} | limsa lominsa = {{{limsa_block}}} | limsan = {{{limsa_block}}} | limsa lominsan = {{{limsa_block}}} | garlean = {{{garlemald_block}}} | imperial = {{{garlemald_block}}} | garlemald = {{{garlemald_block}}} |  ishgard = {{{ishgard_block}}} | ishgardian = {{{ishgard_block}}} | ala mhigo = {{{alamhigo_block}}} | ala mhigan = {{{alamhigo_block}}} | sharlayan = {{{sharlayan_block}}} | doma = {{{doma_block}}} | doman = {{{doma_block}}} | {{{default_block|}}} }}</includeonly><noinclude>
 
{{Arcane-template-syntax}}
 
{{Arcane-template-syntax}}
 
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.
 
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.
Line 16: Line 16:
 
  | '''alamhigo_block''' = The block to display if '''citizenship''' is Ala Mhigo.
 
  | '''alamhigo_block''' = The block to display if '''citizenship''' is Ala Mhigo.
 
  | '''sharlayan_block''' = The block to display if '''citizenship''' is Sharlayan.
 
  | '''sharlayan_block''' = The block to display if '''citizenship''' is Sharlayan.
 +
| '''doma_block''' = The block to display if '''citizenship''' is Doman.
 
  | '''default_block''' = (optional) The block to display if '''citizenship''' can't be reasonably matched to any of the above.  
 
  | '''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.
 
     If this isn't included, a failure to match returns empty text.
Line 30: Line 31:
 
  | alamhigo_block =  
 
  | alamhigo_block =  
 
  | sharlayan_block =  
 
  | sharlayan_block =  
 +
| doma_block =
 
  | default_block =
 
  | default_block =
 
  <nowiki>}}</nowiki>
 
  <nowiki>}}</nowiki>

Latest revision as of 09:17, 13 July 2015

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.
| sharlayan_block = The block to display if citizenship is Sharlayan.
| doma_block = The block to display if citizenship is Doman.
| 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 = 
| sharlayan_block = 
| doma_block = 
| default_block =
}}