Difference between revisions of "Template:Honor prerequisite"

From Pathfinder Wiki
(Don't add to See Also unless invoked from an honor or an IA page.)
Line 4: Line 4:
 
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".
 
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 Answer Key page (which it determines by comparing the third element of the invoking page's title to "Answer Key"), it adds it the category "AY Honor/Prerequisite Answer/<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}}".  If neither of these is true, it is most likely that the invoking page is an honor's landing page (which includes the Answer Key page, and thus inherits the honor_prerequisite template), so it adds the page to the category "AY Honor/Prerequisite/<nowiki>{{{</nowiki>honor}}}nowiki>{{</nowiki>GetLangSuffix}}" and "AY Honor/See Also/<nowiki>{{{</nowiki>honor}}}nowiki>{{</nowiki>GetLangSuffix}}".
+
It will also add the invoking page to one of <nowiki>{{{</nowiki>honor}}}'s prerequisite categories.  If the template is invoked from an Answer Key page (which it determines by comparing the third element of the invoking page's title to "Answer Key"), it adds it the category "AY Honor/Prerequisite Answer/<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}}".  If neither of these is true, it is most likely that the invoking page is an honor's landing page (which includes the Answer Key page, and thus inherits the honor_prerequisite template), so it adds the page to the category "AY Honor/Prerequisite/<nowiki>{{{</nowiki>honor}}}nowiki>{{</nowiki>GetLangSuffix}}" and "AY Honor/See Also/<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.   
 
The "AY Honors/See Also/honor" category is used for adding honors to the "See Also" section of the infobox.   

Revision as of 15:12, 27 February 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 Answer Key page (which it determines by comparing the third element of the invoking page's title to "Answer Key"), it adds it the category "AY Honor/Prerequisite Answer/{{{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}}". If neither of these is true, it is most likely that the invoking page is an honor's landing page (which includes the Answer Key page, and thus inherits the honor_prerequisite template), so it adds the page to the category "AY Honor/Prerequisite/{{{honor}}}nowiki>{{</nowiki>GetLangSuffix}}" and "AY Honor/See Also/{{{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 all three cases, it uses the GetLangSuffix template to add it to the language's category.