Difference between revisions of "Template:Honor prerequisite"

From Pathfinder Wiki
Line 1: Line 1:
<includeonly><nowiki/>{{#vardefine:link|[[AY Honors/{{{honor}}}{{GetLangSuffix}}|{{{displayname|{{{honor}}}}}}]]}}{{#vardefine:first_element|{{#titleparts:{{PAGENAME}}|1|1}}}}{{#if:{{{linkonly|}}}|{{#var:link}}|{{Localize|For tips and instruction see}} {{#var:link}}.}}
+
<includeonly><nowiki/>{{#vardefine:link|[[AY Honors/{{{honor}}}{{GetLangSuffix}}|{{{displayname|{{{honor}}}}}}]]}}{{#vardefine:first_element|{{#titleparts:{{PAGENAME}}|1|1}}}}{{#if:{{{linkonly|}}}|{{#var:link}}|{{Localize|For tips and instruction see}} {{#var:link}}.}}{{#switch:{{#var:first_element}}
{{#switch:|{{#var:first_element}}
 
 
|AY Honors=[[Category:AY Honors/Prerequisite/{{{honor}}}{{GetLangSuffix}}]]
 
|AY Honors=[[Category:AY Honors/Prerequisite/{{{honor}}}{{GetLangSuffix}}]]
 
|Investiture Achievement=[[Category:AY Honors/Prerequisite IA/{{{honor}}}{{GetLangSuffix}}]]}}<nowiki/></includeonly>
 
|Investiture Achievement=[[Category:AY Honors/Prerequisite IA/{{{honor}}}{{GetLangSuffix}}]]}}<nowiki/></includeonly>

Revision as of 00:38, 17 March 2021


This template will add a link to an honor that is a prerequisite along with some localized text to make it serve as an "answer" to a requirement that says "Earn the {{{honor}}} honor".

It will also add the invoking page to one of {{{honor}}}'s prerequisite categories. If the template is invoked from an AY Honors page, it adds it the category "AY Honor/See Also/{{{honor}}}{{GetLangSuffix}}". Else it looks to see if the first element of the page title is "Investiture Achievement", and if it is, it adds itself to the category "AY Honor/Prerequisite IA/{{{honor}}}{{GetLangSuffix}}".

These two categories are used for adding honors to the "See Also" section of the prerequisite's honor_infobox.

Note that in all cases, it uses the GetLangSuffix template to add it to the language's category.