Difference between revisions of "Template:Citizenship-switch"

From RPC Library
Jump to navigation Jump to search
(Created page with "<includeonly>{{#switch: {{lc:{{{citizenship}}}}} | ul'dah = {{{uldah_block}}} | uldah = {{{uldah_block}}} | gridania = {{{gridania_block}}} | limsa = {{{limsa_block}}} | limsa...")
 
Line 1: Line 1:
<includeonly>{{#switch: {{lc:{{{citizenship}}}}} | ul'dah = {{{uldah_block}}} | uldah = {{{uldah_block}}} | gridania = {{{gridania_block}}} | limsa = {{{limsa_block}}} | limsa lominsa = {{{limsa_block}}} | garlean = {{{garlemald_block}}} | garlemald = {{{garlemald_block}}} |  ishgard = {{{ishgard_block}}} | ishgardian = {{{ishgard_block}}} | ala mhigo = {{{alamhigo_block}}} | ala mhigan = {{{alamhigo_block}}} | {{{default_block|}}} }}</includeonly><noinclude>
+
<includeonly>{{#switch: {{lc:{{{citizenship}}}}} | ul'dah = {{{uldah_block}}} | uldah = {{{uldah_block}}} | gridania = {{{gridania_block}}} | limsa = {{{limsa_block}}} | limsa lominsa = {{{limsa_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 12: Line 12:
 
  | '''gridania_block''' = The block to display if '''citizenship''' is Gridania.
 
  | '''gridania_block''' = The block to display if '''citizenship''' is Gridania.
 
  | '''limsa_block''' = The block to display if '''citizenship''' is Limsa Lominsa.
 
  | '''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.  
 
  | '''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 25: Line 22:
 
  | gridania_block =  
 
  | gridania_block =  
 
  | limsa_block =  
 
  | limsa_block =  
| garlemald_block =
 
| ishgard_block =
 
| alamhigo_block =
 
 
  | default_block =
 
  | default_block =
 
  <nowiki>}}</nowiki>
 
  <nowiki>}}</nowiki>

Revision as of 01:00, 5 February 2013

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.
| 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 = 
| default_block =
}}