Difference between revisions of "Template:PrevRoman"
From Pathfinder Wiki
Line 19: | Line 19: | ||
See [[:Template:NextRoman]] for an explanation of the mechanics | See [[:Template:NextRoman]] for an explanation of the mechanics | ||
− | </noinclude>{{#vardefine:landing|{{#titleparts:{{{1}}}|2}}}}{{#vardefine:lastword|{{#explode:{{#var:landing}}| |-1}}}}{{#vardefine:prevroman|{{#replace:{{#var:landing}}|{{#var:lastword}}|{{Prior|{{#var:lastword}}}}}}{{GetLangSuffix|page={{{1}}}}}}}{{#ifexist:{{#ifeq:{{#var:landing}}|{{#var:prevroman}}||{{#var:prevroman}}}}|[[{{#var:prevroman}}|{{GetHonorName|page={{#var:prevroman}}}}]]}} | + | </noinclude>{{#vardefine:landing|{{#titleparts:{{{1}}}|2}}}}{{#vardefine:lastword|{{#explode:{{#var:landing}}| |-1}}}}{{#vardefine:prevroman|{{#replace:{{#var:landing}}|{{#var:lastword}}|{{Prior|{{#var:lastword}}}}}}{{GetLangSuffix|page={{{1}}}}}}}{{#ifexist:{{#ifeq:{{#var:landing}}{{GetLangSuffix|page={{{1}}}}}|{{#var:prevroman}}||{{#var:prevroman}}}}|[[{{#var:prevroman}}|{{GetHonorName|page={{#var:prevroman}}}}]]}} |
Latest revision as of 21:18, 26 June 2021
If the link to the honor in {{{1}}} is an honor that ends with a roman numeral, and the previous honor in the series exists, this template will return a link to that honor. If the honor doesn't end with a roman numeral, or if the previous honor in the series does not exist, it will return nothing.
This template should not be translated. It should work for any language.
Examples
- {{PrevRoman|AY Honors/Camp Craft}} ->
- No roman numeral in the honor name.
- {{PrevRoman|AY Honors/Camping Skills I}} ->
- {{PrevRoman|AY Honors/Camping Skills II}} -> Camping Skills I
- {{PrevRoman|AY Honors/Camping Skills III}} -> Camping Skills II
- {{PrevRoman|AY Honors/Camping Skills III/es}} -> Camping Skills II
- It works in Spanish!
- {{PrevRoman|AY Honors/Camping Skills IV}} -> Camping Skills III
- {{PrevRoman|AY Honors/Bully Prevention I}} ->
- {{PrevRoman|AY Honors/Bully Prevention II}} -> Bully Prevention I
Mechanics
See Template:NextRoman for an explanation of the mechanics