Difference between revisions of "Template:GetMetaData"

From Pathfinder Wiki
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}}}}}}{{#vardefine:landingpage|{{#titleparts:{{#var:srcpage}}|2}}}}{{#dpl:title={{#var:landingpage}}|include={{{{template|HonorLanding}}}}:{{{parameter|honorname}}}}}
+
<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}}}}}}{{#vardefine:landingpage|{{#titleparts:{{#var:srcpage}}|2}}}}{{#dpl:title={{#var:landingpage}}|include={{{{template|HonorLanding}}}}:{{{parameter|honorname}}}}}</includeonly><noinclude>
*{{#var:srcpage}}
 
*{{#var:landingpage}}
 
</includeonly>
 
<noinclude>
 
 
This template returns the value of a parameter as defined in a template on a given honor landing page.  It takes three arguments:
 
This template returns the value of a parameter as defined in a template on a given honor landing page.  It takes three arguments:
 
;page|honor: You can specify either the page or the honor.  If you specify both it will use page.  The page argument is the page title of an honor or one of its subpages.  It accepts translated pages, but ignores that since the metadata is in the honor's "source" page which is in English.  This could give problems when trying to fetch an honorname.  If you need the translated version of any other parameter, you should be able to use [[:Template:Localize]] to convert it.
 
;page|honor: You can specify either the page or the honor.  If you specify both it will use page.  The page argument is the page title of an honor or one of its subpages.  It accepts translated pages, but ignores that since the metadata is in the honor's "source" page which is in English.  This could give problems when trying to fetch an honorname.  If you need the translated version of any other parameter, you should be able to use [[:Template:Localize]] to convert it.

Revision as of 03:46, 22 March 2021

This template returns the value of a parameter as defined in a template on a given honor landing page. It takes three arguments:

page|honor
You can specify either the page or the honor. If you specify both it will use page. The page argument is the page title of an honor or one of its subpages. It accepts translated pages, but ignores that since the metadata is in the honor's "source" page which is in English. This could give problems when trying to fetch an honorname. If you need the translated version of any other parameter, you should be able to use Template:Localize to convert it.
template
If omitted, this will specify which template holds the parameter you want. It defaults to HonorLanding, but if you are experimenting and have some other template in place, you can specify it.
parameter
This specifies which parameter of template you want the template to return. It will always return the English value of the parameter. Again... Template:Localize is your friend, but note that Localize only works on a translate page (or we'd demonstrate it here).

Examples

  • {{GetMetaData|page=AY Honors/Cycling/Requirements|parameter=category}} → Recreation
  • {{GetMetaData|page=AY Honors/Cycling/Requirements/es|parameter=skill}} → 1
  • {{GetMetaData|honor=Camping Skills III|parameter=authority}} → General Conference
  • {{GetMetaData|honor=Animal Tracking (General Conference)|parameter=year}} → 1976