Difference between revisions of "Template:Race-switch"

From RPC Library
Jump to navigation Jump to search
m
m (Added Hrothgar and Viera)
Line 1: Line 1:
<includeonly>{{#switch: {{lc:{{{race}}}}} | hyur = {{#switch: {{lc:{{{clan}}}}} | midland | midlander = {{{hyur_midlander_block}}} | highland | highlander = {{{hyur_highlander_block}}} | {{{hyur_default_block|}}} }} | elezen = {{#switch: {{lc:{{{clan}}}}} | wildwood = {{{elezen_wildwood_block}}} | duskwight = {{{elezen_duskwight_block}}} | {{{elezen_default_block|}}} }} | lalafell = {{#switch: {{lc:{{{clan}}}}} | plainfolk | plainsfolk = {{{lalafell_plainsfolk_block}}} | dunefolk | dunesfolk = {{{lalafell_dunesfolk_block}}} | {{{lalafell_default_block|}}} }} | miqote | mi'qote | miqo'te = {{#switch: {{lc:{{{clan}}}}} | sots | seeker | seekers | seeker of the sun | seekers of the sun = {{{miqote_seekers_block}}} | kotm | keeper | keepers | keeper of the moon | keepers of the moon = {{{miqote_keepers_block}}} | {{{miqote_default_block}}} }} | rogadyn | roegadin | rogadin | rogaedyn | roegadyn = {{#switch: {{lc:{{{clan}}}}} | sea wolf | sea wolves = {{{roegadyn_seawolf_block}}} | hellguard | hellsguard = {{{roegadyn_hellsguard_block}}} | {{{roegadyn_default_block|}}} }} | au ra | auri | aura | au-ra = {{#switch: {{lc:{{{clan}}}}} | xaela | zaela | xela | xala | xaelan = {{{aura_xaela_block}}} | raen | rain = {{{aura_raen_block}}} | {{{aura_default_block|}}} }} | {{{default_block|}}} }}</includeonly><noinclude>
+
<includeonly>{{#switch: {{lc:{{{race}}}}} |  
 +
hyur = {{#switch: {{lc:{{{clan}}}}} | midland | midlander = {{{hyur_midlander_block}}} | highland | highlander = {{{hyur_highlander_block}}} | {{{hyur_default_block|}}} }} |  
 +
elezen = {{#switch: {{lc:{{{clan}}}}} | wildwood = {{{elezen_wildwood_block}}} | duskwight = {{{elezen_duskwight_block}}} | {{{elezen_default_block|}}} }} |  
 +
lalafell = {{#switch: {{lc:{{{clan}}}}} | plainfolk | plainsfolk = {{{lalafell_plainsfolk_block}}} | dunefolk | dunesfolk = {{{lalafell_dunesfolk_block}}} | {{{lalafell_default_block|}}} }} |  
 +
miqote | mi'qote | miqo'te = {{#switch: {{lc:{{{clan}}}}} | sots | seeker | seekers | seeker of the sun | seekers of the sun = {{{miqote_seekers_block}}} | kotm | keeper | keepers | keeper of the moon | keepers of the moon = {{{miqote_keepers_block}}} | {{{miqote_default_block}}} }} |  
 +
rogadyn | roegadin | rogadin | rogaedyn | roegadyn = {{#switch: {{lc:{{{clan}}}}} | sea wolf | sea wolves = {{{roegadyn_seawolf_block}}} | hellguard | hellsguard = {{{roegadyn_hellsguard_block}}} | {{{roegadyn_default_block|}}} }} |  
 +
au ra | auri | aura | au-ra = {{#switch: {{lc:{{{clan}}}}} | xaela | zaela | xela | xala | xaelan = {{{aura_xaela_block}}} | raen | rain = {{{aura_raen_block}}} | {{{aura_default_block|}}} }} |  
 +
hrothgar = {{#switch: {{lc{{{clan}}}}} | helions | helion = {{{hrothgar_helions_block}}} | the lost | lost | thelost = {{{hrothgar_thelost_block}}} | {{{hrothgar_default_block}}} }} |
 +
viera = {{#switch: {{lc{{{clan}}}}} | rava | raba = {{{viera_rava_block}}} | vina | veana | veena = {{{viera_veena_block}}} | {{{viera_default_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 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.
 
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.
Line 31: Line 40:
 
  | '''aura_raen_block''' = The block to display for a Raen Au Ra.
 
  | '''aura_raen_block''' = The block to display for a Raen Au Ra.
 
  | '''aura_default_block''' = (optional) The block to display for an Au Ra whose clan can't be reasonably matched.
 
  | '''aura_default_block''' = (optional) The block to display for an Au Ra whose clan can't be reasonably matched.
 +
| '''hrothgar_helions_block''' = The block to display for a Helion Hrothgar.
 +
| '''hrothgar_thelost_block''' = The block to display for The Lost Hrothgar.
 +
| '''hrothgar_default_block''' = (optional) The block to display for a Hrothgar whose clan can't be reasonably matched.
 +
| '''viera_rava_block''' = The block to display for a Rava Viera.
 +
| '''viera_veena_block''' = The block to display for a Veena Viera.
 +
| '''viera_default_block''' = (optional) The block to display for a Viera 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.  
 
  | '''default_block''' = (optional) The block to display if '''race''' can't be reasonably matched to any of the above.  
 
  <nowiki>}}</nowiki>
 
  <nowiki>}}</nowiki>
Line 55: Line 70:
 
  | aura_xaela_block =  
 
  | aura_xaela_block =  
 
  | aura_raen_block =  
 
  | aura_raen_block =  
 +
| aura_default_block =
 +
| hrothgar_helions_block =
 +
| hrothgar_thelost_block =
 +
| hrothgar_default_block =
 +
| viera_rava_block =
 +
| viera_veena_block =
 +
| viera_default_block =
 
  | default_block =  
 
  | default_block =  
 
  <nowiki>}}</nowiki>
 
  <nowiki>}}</nowiki>

Revision as of 20:37, 13 July 2019

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.
| aura_xaela_block = The block to display for a Xaela Au Ra.
| aura_raen_block = The block to display for a Raen Au Ra.
| aura_default_block = (optional) The block to display for an Au Ra whose clan can't be reasonably matched.
| hrothgar_helions_block = The block to display for a Helion Hrothgar.
| hrothgar_thelost_block = The block to display for The Lost Hrothgar.
| hrothgar_default_block = (optional) The block to display for a Hrothgar whose clan can't be reasonably matched.
| viera_rava_block = The block to display for a Rava Viera.
| viera_veena_block = The block to display for a Veena Viera.
| viera_default_block = (optional) The block to display for a Viera 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 = 
| aura_xaela_block = 
| aura_raen_block = 
| aura_default_block =
| hrothgar_helions_block =
| hrothgar_thelost_block =
| hrothgar_default_block =
| viera_rava_block =
| viera_veena_block = 
| viera_default_block = 
| default_block = 
}}