Difference between revisions of "Template:GetPreferredVariant"

From Pathfinder Wiki
Line 1: Line 1:
<includeonly>{{#vardefine:country|{{GetUserData|data=Country}}}}{{#vardefine:conference|{{GetUserData|data=Conference}}}}{{#vardefine:union|{{GetUserData|data=Union}}}}{#vardefine:division|{{GetUserData|data=Division}}}}{{#if:{{#var:country}}||{{#vardefine:country|none}}}}{{#if:{{#var:conference}}||{{#vardefine:conference|none}}}}{{#if:{{#var:union}}||{#vardefine:union|none}}}}
+
<includeonly>{{#vardefine:country|{{GetUserData|data=Country}}}}{{#vardefine:conference|{{GetUserData|data=Conference}}}}{{#vardefine:union|{{GetUserData|data=Union}}}}{{#vardefine:division|{{GetUserData|data=Division}}}}{{#if:{{#var:country}}||{{#vardefine:country|none}}}}{{#if:{{#var:conference}}||{{#vardefine:conference|none}}}}{{#if:{{#var:union}}||{#vardefine:union|none}}}}
 
{{#if:{{#var:division}}||{{#vardefine:division|none}}}}{{#if:{{#pos:{{{variants}}}|{{#var:country}}}}|{{#var:country}}|{{#if:{{#pos:{{{variants}}}|{{#var:conference}}}}|{{#var:conference}}|{{#if:{{#pos:{{{variants}}}|{{#var:union}}}}|{{#var:union}}|{{#if:{{#pos:{{{variants}}}|{{#var:division}}}}|{{#var:division}}|{{#if:{{#pos:{{{variants}}}|General Conference}}|General Conference}}}}}}}}}}{{#if:{{{debug|}}}|
 
{{#if:{{#var:division}}||{{#vardefine:division|none}}}}{{#if:{{#pos:{{{variants}}}|{{#var:country}}}}|{{#var:country}}|{{#if:{{#pos:{{{variants}}}|{{#var:conference}}}}|{{#var:conference}}|{{#if:{{#pos:{{{variants}}}|{{#var:union}}}}|{{#var:union}}|{{#if:{{#pos:{{{variants}}}|{{#var:division}}}}|{{#var:division}}|{{#if:{{#pos:{{{variants}}}|General Conference}}|General Conference}}}}}}}}}}{{#if:{{{debug|}}}|
 
*variants={{{variants}}}
 
*variants={{{variants}}}

Revision as of 02:44, 9 April 2021

This template accepts a comma-deliniated list of honor variants and compares them to the user's profile data. It returns the lowest-level variant (country, conference, union, division, GC) that matches the user's profile. This can be used to decide which requirements to show, or which answer key to feature, etc.

Examples

  • {{GetPreferredVariant|variants=Bermuda,Canada,United States}} → {#vardefine:union}}
  • variants=Bermuda,Canada,United States
  • country=none
  • conference=none
  • union=
  • division=none
  • pos=
  • {{GetPreferredVariant|variants=North American Division,General Conference,Atlantic Union,Northern New England}} → {#vardefine:union}}
  • variants=North American Division,General Conference,Atlantic Union,Northern New England
  • country=none
  • conference=none
  • union=
  • division=none
  • pos=
  • {{GetPreferredVariant|variants=North American Division,General Conference,Atlantic Union}} → {#vardefine:union}}
  • {{GetPreferredVariant|variants=North American Division,General Conference}} → {#vardefine:union}}
  • {{GetPreferredVariant|variants=South American Division,General Conference}} → {#vardefine:union}}