Difference between revisions of "Template:Has Variant"
From Pathfinder Wiki
(Created page with "<noinclude> Returns page title of division variant if it exists. Returns an empty string otherwise. {{#vardefine:gcCycle|{{Has Variant|page=AY Honors/Cycling - Advanced|div...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
Returns page title of division variant if it exists. Returns an empty string otherwise. | Returns page title of division variant if it exists. Returns an empty string otherwise. | ||
+ | ;page: Title of page we want to check for a variant. If not specified, the template assumes it is being invoked from an honor landing page and uses that as the basis for the variant check. Variants are located at <nowiki>[[</nowiki>AY Honors/''honor'' (''division'')]]. | ||
+ | |||
+ | ;division: If specified, the template will use the value assigned as the ''division'' when it looks for a page. If not specified, it defaults to "General Conference". | ||
+ | |||
+ | |||
+ | ==Example== | ||
+ | <nowiki>{{</nowiki>Has Variant|page=AY Honors/Cycling - Advanced}} | ||
+ | |||
+ | :{{Has Variant|page=AY Honors/Cycling - Advanced}} | ||
+ | |||
+ | As shown above, the output format is just the title of the page (if it exists) or en empty string. If you want a link, you need to supply that brackets. If you want to suppress the "AY Honors" part when you display the link, you can use #titleparts to extract the honor name from the output of the template. | ||
{{#vardefine:gcCycle|{{Has Variant|page=AY Honors/Cycling - Advanced|division=General Conference}}}} | {{#vardefine:gcCycle|{{Has Variant|page=AY Honors/Cycling - Advanced|division=General Conference}}}} | ||
Line 10: | Line 21: | ||
</noinclude><includeonly> | </noinclude><includeonly> | ||
− | {{#vardefine:variant|{{#titleparts:{{{page|{{PAGENAME}}}}}|2|1}} ({{{division|General Conference}}})}} | + | {{#vardefine:variant|{{#titleparts:{{{page|{{PAGENAME}}}}}|2|1}} ({{{division|General Conference}}}){{GetLangSuffix}}}} |
{{#ifexist:{{#var:variant}}|{{#var:variant}}}} | {{#ifexist:{{#var:variant}}|{{#var:variant}}}} | ||
</includeonly> | </includeonly> |
Latest revision as of 04:51, 26 February 2021
Returns page title of division variant if it exists. Returns an empty string otherwise.
- page
- Title of page we want to check for a variant. If not specified, the template assumes it is being invoked from an honor landing page and uses that as the basis for the variant check. Variants are located at [[AY Honors/honor (division)]].
- division
- If specified, the template will use the value assigned as the division when it looks for a page. If not specified, it defaults to "General Conference".
Example
{{Has Variant|page=AY Honors/Cycling - Advanced}}
AY Honors/Cycling - Advanced (General Conference)
As shown above, the output format is just the title of the page (if it exists) or en empty string. If you want a link, you need to supply that brackets. If you want to suppress the "AY Honors" part when you display the link, you can use #titleparts to extract the honor name from the output of the template.
AY Honor Cycling - Advanced has a GC variant at AY Honor Cycling - Advanced.
AY Honor Biosafety has a SAD variant at AY Honor Biosafety.