Difference between revisions of "Template:GetHonorLandingPage"

From Pathfinder Wiki
(- removed linebreak after the result and updated example to fit the new honor structure)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:page|{{{page|{{#if:{{{honor|}}}|AY Honors/{{{honor}}}|{{#titleparts:{{PAGENAME}}|2}}}}}}}}}{{#vardefine:srcpage|{{#if:{{#explode:{{#var:page}}|(|1}}}|{{#explode:{{#var:page}}|(|0}}|{{#var:page}}}}}}{{#titleparts:{{#var:srcpage}}|2}}
+
<includeonly>{{#vardefine:page
</includeonly>
+
            |{{{page|{{#if:{{{honor|}}}
<noinclude>
+
                          |AY Honors/{{{honor}}}
This template returns the page title of an honor's main landing page.  It accepts a page argument which can be any subpage of an honor, and it can also be any variant of an honor.  If no page argument is given, it can accept an honor instead.
+
                          |{{#titleparts:{{PAGENAME}}|2}}
 +
                    }}
 +
            }}}
 +
}}{{#titleparts:{{#var:page}}|2}}</includeonly><noinclude>
 +
This template returns the page title of an honor's main landing page.  It accepts a page argument which can be any subpage of an honor, and it can also be any variant of an honor.  If no page argument is given, it can accept an honor instead.  If neither a page nor an honor argument is supplied, the template will assume it is being invoked from an honor page or subpage.
  
 
The page the template returns is the master source of metadata for the honor.
 
The page the template returns is the master source of metadata for the honor.
  
*<nowiki>{{</nowiki>GetLandingPage}} &rarr; {{GetLandingPage}}
+
*<nowiki>{{</nowiki>GetHonorLandingPage}} &rarr; {{GetHonorLandingPage}}
*<nowiki>{{</nowiki>GetLandingPage|page=AY Honors/Cycling/Requirements}} &rarr; {{GetLandingPage|page=AY Honors/Cycling/Requirements}}
+
*<nowiki>{{</nowiki>GetHonorLandingPage|page=AY Honors/Cycling/Requirements}} &rarr; {{GetHonorLandingPage|page=AY Honors/Cycling/Requirements}}
*<nowiki>{{</nowiki>GetLandingPage|page=AY Honors/Cycling/Requirements/es}} &rarr; {{GetLandingPage|page=AY Honors/Cycling/Requirements/es}}
+
*<nowiki>{{</nowiki>GetHonorLandingPage|page=AY Honors/Cycling/Requirements/es}} &rarr; {{GetHonorLandingPage|page=AY Honors/Cycling/Requirements/es}}
*<nowiki>{{</nowiki>GetLandingPage|page=AY Honors/Currency (United States)/Answer Key}} &rarr; {{GetLandingPage|page=AY Honors/Currency (United States)/Answer Key}}
+
*<nowiki>{{</nowiki>GetHonorLandingPage|page=AY Honors/Currency/Answer Key 2}} &rarr; {{GetHonorLandingPage|page=AY Honors/Currency/Answer Key 2}}
*<nowiki>{{</nowiki>GetLandingPage|honor=Camping Skills III}} &rarr; {{GetLandingPage|honor=Camping Skills III}}
+
*<nowiki>{{</nowiki>GetHonorLandingPage|honor=Camping Skills III}} &rarr; {{GetHonorLandingPage|honor=Camping Skills III}}
*<nowiki>{{</nowiki>GetLandingPage|honor=Animal Tracking (General Conference)}} &rarr; {{GetLandingPage|honor=Animal Tracking (General Conference)}}
+
*<nowiki>{{</nowiki>GetHonorLandingPage|honor=Animal Tracking}} &rarr; {{GetHonorLandingPage|honor=Animal Tracking}}
 
 
 
 
 
</noinclude>
 
</noinclude>

Latest revision as of 18:45, 5 September 2021

This template returns the page title of an honor's main landing page. It accepts a page argument which can be any subpage of an honor, and it can also be any variant of an honor. If no page argument is given, it can accept an honor instead. If neither a page nor an honor argument is supplied, the template will assume it is being invoked from an honor page or subpage.

The page the template returns is the master source of metadata for the honor.

  • {{GetHonorLandingPage}} → GetHonorLandingPage
  • {{GetHonorLandingPage|page=AY Honors/Cycling/Requirements}} → AY Honors/Cycling
  • {{GetHonorLandingPage|page=AY Honors/Cycling/Requirements/es}} → AY Honors/Cycling
  • {{GetHonorLandingPage|page=AY Honors/Currency/Answer Key 2}} → AY Honors/Currency
  • {{GetHonorLandingPage|honor=Camping Skills III}} → AY Honors/Camping Skills III
  • {{GetHonorLandingPage|honor=Animal Tracking}} → AY Honors/Animal Tracking