Template:GetMasterCategoryList

From Pathfinder Wiki
Revision as of 22:09, 14 January 2021 by Jomegat (talk | contribs)

This template outputs a <br/> separated list of category links to the Master Awards an honor belongs to. It was designed to be used by the honor_infobox template.

Example

{{GetMasterCategoryList
|category=Arts, Crafts and Hobbies
|master=Crime
|master2=Punishment
}}



Artisan Master Award
Crime Master Award
Punishment Master Award


Mechanics

The output list is stored in a variable called mlist (master list) and that is emitted at the end of the template.

It starts by looking at the {{{category}}} parameter and assigning a mlist to one of the category-based Master Awards. Not every honor category results in a Master Award, so the switch statement doesn't deal with all of the known categories. In other words, mlist may or may not be empty when we come out of the switch statement.

It then looks to see if the {{{master}}} argument specified that the honor is part of some other Master Award, and if it is, it adds that to mlist. If mlist already has something assigned to it, the code will append mlist with a <br/> tag before appending the master award category. It then repeats that logic using {{{master2}}}.