Difference between revisions of "Template:Reqreq"
From Pathfinder Wiki
DesignerThan (talk | contribs) |
(Add ability to specify a reqpage) |
||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
This template extracts requirement '''num''' from page '''page''' and displays it in a way that is useful when you just want the requirement without any formatting. | This template extracts requirement '''num''' from page '''page''' and displays it in a way that is useful when you just want the requirement without any formatting. | ||
− | |||
− | |||
− | |||
− | |||
Example: | Example: | ||
Line 15: | Line 11: | ||
[[Category:Requirements Template]] | [[Category:Requirements Template]] | ||
− | </noinclude>{{#if:{{{ | + | </noinclude>{{#if:{{#pos:{{{page|}}} |
− | + | |Requirements}} | |
+ | |{{#vardefine:reqpage|{{{page}}}}} | ||
+ | |{{#vardefine:reqpage|{{#titleparts:{{{page}}}|2|1}}/Requirements}}}}{{#if:{{{dispreq|}}}|{{{dispreq}}}|{{{num}}}.}} {{#lst:{{#var:reqpage}}{{GetLangSuffix}} | ||
+ | |req{{{num}}} | ||
}} | }} |
Revision as of 02:28, 24 September 2021
This template extracts requirement num from page page and displays it in a way that is useful when you just want the requirement without any formatting.
Example:
{{reqreq|page=AY Honors/Amphibians|num=1}}
shows requirement 1 of the Amphibians honor, displayed as below:
1. What are the characteristics of amphibians?
This uses the #lst: parser directive which takes two arguments: a page, and a section identifier. The page it references must have section tags with <section begin=''identifier''> and <section end=''identifier''>, with the requirement placed between the two tags.
{{{num}}}.