Difference between revisions of "Template:Honor infobox"

From Pathfinder Wiki
Line 36: Line 36:
 
<includeonly><!-- Get the List of Master Honors -->{{#vardefine:localCategory|{{{category|{{GetHonorMetaData|language=/en}}}}}}}{{#vardefine:master|{{GetMasterCategoryList|category={{#var:localCategory}}|master1={{{master1|{{GetHonorMetaData|language=/en|parameter=master1}}}}}|master2={{{master2|{{GetHonorMetaData|language=/en|parameter=master2}}}}}}}}}<!-- create the string-variables holding the content for the see more section -->{{#vardefine:i|0}}{{#vardefine:locSeeAlsoLess|}}{{#vardefine:locSeeAlsoMore|}}<!-- get all interesting links for see also into one variable separated by | -->{{#vardefine:locSeeAlsoAll|{{#var:master}}{{GetHonorSeeAlso}}}}{{#if:{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} | {{#vardefine:locSeeAlsoLess|{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} }}{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }}{{#while: | {{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} | {{#ifexpr: {{#var:i}}<3|<!--yes-->{{#vardefine:locSeeAlsoLess|{{#var:locSeeAlsoLess}}<br>{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} }}|<!--no-->{{#vardefine:locSeeAlsoMore|{{#var:locSeeAlsoMore}}{{#ifexpr:{{#var:i}}>3|<br>}}{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} }} }}{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }} }} }}<!-- get the patch -->{{#vardefine:localInsignia|{{{insignia|{{GetHonorMetaData|language=/en|parameter=insignia|dontTranslate=true}}}}}}}{{#vardefine:honorstate|{{{state|{{GetHonorMetaData|language=/en|parameter=state}}}}}}}{{#vardefine:patch|{{#if:{{#var:localInsignia}}|{{#switch:{{#var:localInsignia}}
 
<includeonly><!-- Get the List of Master Honors -->{{#vardefine:localCategory|{{{category|{{GetHonorMetaData|language=/en}}}}}}}{{#vardefine:master|{{GetMasterCategoryList|category={{#var:localCategory}}|master1={{{master1|{{GetHonorMetaData|language=/en|parameter=master1}}}}}|master2={{{master2|{{GetHonorMetaData|language=/en|parameter=master2}}}}}}}}}<!-- create the string-variables holding the content for the see more section -->{{#vardefine:i|0}}{{#vardefine:locSeeAlsoLess|}}{{#vardefine:locSeeAlsoMore|}}<!-- get all interesting links for see also into one variable separated by | -->{{#vardefine:locSeeAlsoAll|{{#var:master}}{{GetHonorSeeAlso}}}}{{#if:{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} | {{#vardefine:locSeeAlsoLess|{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} }}{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }}{{#while: | {{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} | {{#ifexpr: {{#var:i}}<3|<!--yes-->{{#vardefine:locSeeAlsoLess|{{#var:locSeeAlsoLess}}<br>{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} }}|<!--no-->{{#vardefine:locSeeAlsoMore|{{#var:locSeeAlsoMore}}{{#ifexpr:{{#var:i}}>3|<br>}}{{#explode: {{#var:locSeeAlsoAll}}|%{{!}}%|{{#var:i}} }} }} }}{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }} }} }}<!-- get the patch -->{{#vardefine:localInsignia|{{{insignia|{{GetHonorMetaData|language=/en|parameter=insignia|dontTranslate=true}}}}}}}{{#vardefine:honorstate|{{{state|{{GetHonorMetaData|language=/en|parameter=state}}}}}}}{{#vardefine:patch|{{#if:{{#var:localInsignia}}|{{#switch:{{#var:localInsignia}}
 
|No Patch.png
 
|No Patch.png
|No_Patch.png={{Localize|{{#ifep:{{#var:honorstate}}|piloting|Pilot }}No Patch|Images}}
+
|No_Patch.png={{Localize|{{#ifeq:{{#var:honorstate}}|piloting|Pilot }}No Patch|Images}}
 
|{{#var:localInsignia}}
 
|{{#var:localInsignia}}
}}|{{Localize|{{#ifep:{{#var:honorstate}}|piloting|Pilot }}No Patch|Images}}}}}}<!--
+
}}|{{Localize|{{#ifeq:{{#var:honorstate}}|piloting|Pilot }}No Patch|Images}}}}}}<!--
 
check if Not availabel at AdventSource should be shown
 
check if Not availabel at AdventSource should be shown
 
-->{{#vardefine:locPilotAuthor|{{#ifeq:{{#var:honorstate}}|piloting|{{{pilotAuthor|{{GetHonorMetaData|language=/en|parameter=pilotAuthor}}}}}}}|}}{{#vardefine:showNotAdventSrc|{{#ifeq:{{#var:honorstate}}|piloting|true|{{#if:{{{insignia_source|{{GetHonorMetaData|language=/en|parameter=insignia_source}}}}}|true|false}}}}}}
 
-->{{#vardefine:locPilotAuthor|{{#ifeq:{{#var:honorstate}}|piloting|{{{pilotAuthor|{{GetHonorMetaData|language=/en|parameter=pilotAuthor}}}}}}}|}}{{#vardefine:showNotAdventSrc|{{#ifeq:{{#var:honorstate}}|piloting|true|{{#if:{{{insignia_source|{{GetHonorMetaData|language=/en|parameter=insignia_source}}}}}|true|false}}}}}}

Revision as of 11:08, 6 March 2022

This template creates an infobox for an honor.

Mechanics

The mechanics are just opaque magic (sorry).

Example

<div style="max-width: 300px">

{{Honor infobox
|honorlandingpage=AY Honors/Camping Skills IV
|skill=2
|year=2001
|category=Recreation
|authority=General Conference
|insignia=Camping_Skills_IV.png
|insignia_source=foo
|master1=Wilderness
}}

</div>


Camping Skills IV
Recreation
Skill Level
123
Approval authority
General Conference
Year of Introduction
2001
See also