Difference between revisions of "Template:Honor prerequisite"

From Pathfinder Wiki
m
 
(14 intermediate revisions by 2 users not shown)
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}}.}}{{#switch:{{#var:first_element}}
+
<includeonly><nowiki/>{{#vardefine:link|[[AY Honors/{{{honor}}}{{GetLangSuffix}}|{{GetHonorName|page=AY Honors/{{{honor}}}{{GetLangSuffix}}}}]]}}{{#vardefine:third_element|{{#titleparts:{{PAGENAME}}|1|3}}}}{{#vardefine:first_element|{{#titleparts:{{PAGENAME}}|1|1}}}}
|AY Honors=[[Category:AY Honors/Prerequisite/{{{honor}}}{{GetLangSuffix}}]]
+
{{#if:{{{linkonly|}}}|{{#var:link}}|{{Localize|For tips and instruction see}} {{#var:link}}.}}
|Investiture Achievement=[[Category:AY Honors/Prerequisite IA/{{{honor}}}{{GetLangSuffix}}]]}}<nowiki/></includeonly>
+
{{#switch:{{#var:first_element}}
<noinclude>
+
|AY Honors={{#ifeq:{{#var:third_element}}|Answer Key
 +
                  |[[Category:AY Honors/Prerequisite/{{{honor}}}{{GetLangSuffix}}]]
 +
                    [[Category:AY Honors/See Also/{{{honor}}}{{GetLangSuffix}}]]}}
 +
|Investiture Achievement=[[Category:AY Honors/Prerequisite IA/{{{honor}}}{{GetLangSuffix}}{{!}}{{GetIaSortKey|page={{PAGENAME}}}}]]}}<nowiki/></includeonly><noinclude>
 +
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 <nowiki>{{{</nowiki>honor}}} honor".
 +
 
 +
It will also add the invoking page to one of <nowiki>{{{</nowiki>honor}}}'s prerequisite categories.
 +
 
 +
If the template is invoked from an honor's Answer Key page (which it determines by comparing the first element of the invoking page's title to "AY Honors", and the third element to "Answer Key"), it adds it the category "AY Honor/Prerequisite<nowiki>{{{</nowiki>honor}}}<nowiki>{{</nowiki>GetLangSuffix}}" as well as to the category "AY Honors/See Also/<nowiki>{{{</nowiki>honor}}}<nowiki>{{</nowiki>GetLangSuffix}}. It checks the third element against "Answer Key" so that variant answer keys do not get added to the category (which would cause SeeAlso to list that honor multiple times in the infobox).
  
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 <nowiki>{{{</nowiki>honor}}} honor".
+
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/<nowiki>{{{</nowiki>honor}}}<nowiki>{{</nowiki>GetLangSuffix}}".
 +
The "AY Honors/See Also/honor" category is used for adding honors to the "See Also" section of the infobox.
 +
 
 +
Note that in both cases, it uses the GetLangSuffix template to add it to the language's category.
 +
 
 +
Example:
 +
 
 +
linkonly = true
  
It will also add the invoking page to one of <nowiki>{{{</nowiki>honor}}}'s prerequisite categories.  If the template is invoked from an AY Honors page, it adds it the category "AY Honor/See Also/<nowiki>{{{</nowiki>honor}}}<nowiki>{{</nowiki>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/<nowiki>{{{</nowiki>honor}}}<nowiki>{{</nowiki>GetLangSuffix}}".
+
{{honor_prerequisite|honor=Braiding|linkonly=true}}
  
These two categories are used for adding honors to the "See Also" section of the prerequisite's honor_infobox. 
+
linkonly not named
  
Note that in all cases, it uses the GetLangSuffix template to add it to the language's category.
+
{{honor_prerequisite|honor=Braiding}}
 
</noinclude>
 
</noinclude>

Latest revision as of 17:46, 14 July 2022

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 honor's Answer Key page (which it determines by comparing the first element of the invoking page's title to "AY Honors", and the third element to "Answer Key"), it adds it the category "AY Honor/Prerequisite{{{honor}}}{{GetLangSuffix}}" as well as to the category "AY Honors/See Also/{{{honor}}}{{GetLangSuffix}}. It checks the third element against "Answer Key" so that variant answer keys do not get added to the category (which would cause SeeAlso to list that honor multiple times in the infobox).

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}}". The "AY Honors/See Also/honor" category is used for adding honors to the "See Also" section of the infobox.

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

Example:

linkonly = true

linkonly not named

For tips and instruction see Braiding.