Template:Race-switch

From RPC Library
Revision as of 20:08, 3 February 2013 by Deirdre (talk | contribs) (Created page with "<includeonly>{{#switch: {{lc:{{{race}}}}} | hyur = {{#switch: {{lc:{{{clan}}}}} | midland | midlander = {{{hyur_midlander_block}}} | highland | highlander = {{{hyur_highlander...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 race parameter. This allows you to display different text depending on the race and clan 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 to new races and to support new and creative misspellings of their 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 |.

If any default block isn't included, a match to it returns empty text. It's highly recommended that defaults be provided for each race; the overall default need not be provided.

Syntax

{{Race-switch
| race = The character's race, which should be some reasonable facsimile of an available race.
    The template will attempt to automagically handle misspellings.
| clan = The character's clan in that race, which should be some reasonable facsimile of the clan's name.
    The template will attempt to automagically handle misspellings.
| hyur_midlander_block = The block to display for a Midlander Hyur.
| hyur_highlander_block = The block to display for a Highlander Hyur. 
| hyur_default_block = (optional) The block to display for a Hyur whose clan can't be reasonably matched.
| elezen_wildwood_block = The block to display for a Wildwood Elezen.
| elezen_duskwight_block = The block to display for a Duskwight Elezen.
| elezen_default_block = (optional) The block to display for an Elezen whose clan can't be reasonably matched.
| lalafell_plainsfolk_block = The block to display for a Plainsfolk Lalafell.
| lalafell_dunesfolk_block = The block to display for a Dunesfolk Lalafell.
| lalafell_default_block = (optional) The block to display for a Lalafell whose clan can't be reasonably matched.
| miqote_seekers_block = The block to display for a Miqo'te Seeker of Sun.
| miqote_keepers_block = The block to display for a Miqo'te Keeper of the Moon.
| miqote_default_block = (optional) The block to display for a Miqo'te whose clan can't be reasonably matched.
| roegadyn_seawolf_block = The block to display for a Roegadyn Sea Wolf.
| roegadyn_hellsguard_block = The block to display for a Roegadyn Hellsguard.
| roegadyn_default_block = (optional) The block to display for a Roegadyn whose clan can't be reasonably matched.
| default_block = (optional) The block to display if race can't be reasonably matched to any of the above. 
}}

Copy-paste

{{Race-switch
| race = 
| clan = 
| hyur_midlander_block = 
| hyur_highlander_block = 
| hyur_default_block = 
| elezen_wildwood_block = 
| elezen_duskwight_block = 
| elezen_default_block = 
| lalafell_plainsfolk_block = 
| lalafell_dunesfolk_block = 
| lalafell_default_block = 
| miqote_seekers_block = 
| miqote_keepers_block = 
| miqote_default_block = 
| roegadyn_seawolf_block = 
| roegadyn_hellsguard_block = 
| roegadyn_default_block = 
| default_block = 
}}