Difference between revisions of "Template:Reqreqlink"

From Pathfinder Wiki
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This template is used for building a table of contents at the top of an honor answer page.  Each invocation will create a link to the table holding the requirement as defined by (and in cooperation with) [[Template:AnswerRequirement]].
+
This template is used for building a table of contents at the top of an honor answer page.  Each invocation will create a link to the table holding the requirement as defined by (and in cooperation with) [[Template:ansreq]].
  
 
It takes two arguments:
 
It takes two arguments:
Line 8: Line 8:
  
 
Example:
 
Example:
<nowiki>{{reqreqlink|page=Adventist Youth Honors Answer Book/Nature/Amphibians|num=6}}</nowiki>
+
<nowiki>{{</nowiki>reqreqlink|page=AY Honors/Amphibians|num=6}}
  
 
Yields this:
 
Yields this:
  
{{reqreqlink|page=Adventist Youth Honors Answer Book/Nature/Amphibians|num=6}}
+
{{reqreqlink|page=AY Honors/Amphibians|num=6}}
  
 
===Mechanics===
 
===Mechanics===
This relies on the [[Template:AnswerRequirement]], which adds an </nowiki>id=ansreq-{{{num}}}</nowiki> attribute to the table it creates to hold the requirement text.  That id creates an anchor that this template references with <nowiki>[[#ansreq-{{{num}}}]]</nowiki>.  The value displayed for the link target is fetched by [[Template:reqreq]].
+
This relies on the [[Template:ansreq]], which adds an </nowiki>id=mw-customcollapsible-ansreq-{{{num}}}</nowiki> attribute to the table it creates to hold the requirement text.  That id creates an anchor that this template references with <nowiki>[[#mw-customcollapsible-ansreq-{{{num}}}]]</nowiki>.  The value displayed for the link target is fetched by [[Template:reqreq]].
  
 
[[Category:Requirements Template]]
 
[[Category:Requirements Template]]
 
</noinclude>
 
</noinclude>
<includeonly><b>[[#ansreq-{{{num}}}|{{reqreq|page={{{page}}}|num={{{num}}}}}]]</b>
+
<includeonly><b>[[#mw-customcollapsible-ansreq-{{{num}}}|{{reqreq|page={{{page}}}|num={{{num}}}}}]]</b>

Revision as of 03:22, 6 March 2021

This template is used for building a table of contents at the top of an honor answer page. Each invocation will create a link to the table holding the requirement as defined by (and in cooperation with) Template:ansreq.

It takes two arguments:

page
This should point to the honor page. In most cases we can use page=Reqreqlink for this.
num
This is the requirement number. It must match the <section begin=NNN> found in the requirements page.

The template should not need translation. If the honor page has a recognized language identifier at the end of the page name, it will extract the translated requirement.

Example: {{reqreqlink|page=AY Honors/Amphibians|num=6}}

Yields this:


6. Describe the life history of some amphibian.

Mechanics

This relies on the Template:ansreq, which adds an </nowiki>id=mw-customcollapsible-ansreq-{{{num}}}</nowiki> attribute to the table it creates to hold the requirement text. That id creates an anchor that this template references with [[#mw-customcollapsible-ansreq-{{{num}}}]]. The value displayed for the link target is fetched by Template:reqreq.