Difference between revisions of "Template:PrevRoman"
From Pathfinder Wiki
(Copy from NextRoman) |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
− | If the link to the honor in '''{{{1}}}''' is an honor that ends with a roman numeral, and the | + | 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. | This template should not be translated. It should work for any language. | ||
==Examples== | ==Examples== | ||
− | *<nowiki>{{</nowiki> | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Camp Craft}} -> {{PrevRoman|AY Honors/Camp Craft}} |
:No roman numeral in the honor name. | :No roman numeral in the honor name. | ||
− | *<nowiki>{{</nowiki> | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Camping Skills I}} -> {{PrevRoman|AY Honors/Camping Skills I}} |
− | *<nowiki>{{</nowiki> | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Camping Skills II}} -> {{PrevRoman|AY Honors/Camping Skills II}} |
− | *<nowiki>{{</nowiki> | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Camping Skills III}} -> {{PrevRoman|AY Honors/Camping Skills III}} |
− | *<nowiki>{{</nowiki> | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Camping Skills III/es}} -> {{PrevRoman|AY Honors/Camping Skills III/es}} |
:It works in Spanish! | :It works in Spanish! | ||
− | *<nowiki>{{</nowiki> | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Camping Skills IV}} -> {{PrevRoman|AY Honors/Camping Skills IV}} |
− | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Bully Prevention I}} -> {{PrevRoman|AY Honors/Bully Prevention I}} | |
− | *<nowiki>{{</nowiki> | + | *<nowiki>{{</nowiki>PrevRoman|AY Honors/Bully Prevention II}} -> {{PrevRoman|AY Honors/Bully Prevention II}} |
− | *<nowiki>{{</nowiki> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
==Mechanics== | ==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}}{{GetLangSuffix|page={{{1}}}}}|{{#var:prevroman}}||{{#var:prevroman}}}}|[[{{#var:prevroman}}|{{GetHonorName|page={{#var:prevroman}}}}]]}} | |
− | |||
− | </noinclude>{{#vardefine:landing|{{#titleparts:{{{1}}}|2}}}}{{#vardefine:lastword|{{#explode:{{#var:landing}}| |-1}}}}{{#vardefine: |
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