Difference between revisions of "Template:Honor infobox"
From Pathfinder Wiki
DesignerThan (talk | contribs) |
DesignerThan (talk | contribs) |
||
(12 intermediate revisions by the same user not shown) | |||
Line 34: | Line 34: | ||
<!--T:4--> | <!--T:4--> | ||
[[Category:UsesLoops]]</noinclude> | [[Category:UsesLoops]]</noinclude> | ||
− | <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: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|dontTranslate=true|parameter=state}}}}}}}{{#vardefine:patch|{{#if:{{#var:localInsignia}}|{{#switch:{{#var:localInsignia}} |
|No Patch.png | |No Patch.png | ||
− | |No_Patch.png={{Localize|No Patch|Images}} | + | |No_Patch.png={{Localize|{{#ifeq:{{#var:honorstate}}|piloting|Pilot No Patch|No Patch}}|Images}} |
|{{#var:localInsignia}} | |{{#var:localInsignia}} | ||
− | }}|{{Localize|No Patch|Images}}}}}}<!-- | + | }}|{{Localize|{{#ifeq:{{#var:honorstate}}|piloting|Pilot No Patch|No Patch}}|Images}}}}}}<!-- |
check if Not availabel at AdventSource should be shown | check if Not availabel at AdventSource should be shown | ||
− | -->{{#vardefine:honorstate|{{{ | + | -->{{#vardefine:locPilotAuthor|{{#ifeq:{{#var:honorstate}}|piloting|{{{pilotAuthor|{{GetHonorMetaData|dontTranslate=true|parameter=pilotAuthor}}}}}}}|}}{{#vardefine:showNotAdventSrc|{{#ifeq:{{#var:honorstate}}|piloting|true|{{#if:{{{insignia_source|{{GetHonorMetaData|language=/en|parameter=insignia_source}}}}}|true|false}}}}}} |
− | <templatestyles src="Honor infobox/style.css" /><div class="mw-parser-output | + | <templatestyles src="Honor infobox/style.css" /><div class="mw-parser-output"> |
{{Infobox | {{Infobox | ||
|bodyclass=honor-infobox | |bodyclass=honor-infobox | ||
− | |above={{#ifeq:{{#var:honorstate}}|piloting|NAD Pilot for|{{GetHonorName|page={{{honorlandingpage|}}}}}}} | + | |above={{#ifeq:{{#var:honorstate}}|piloting|{{Localize|NAD Pilot for}}|{{GetHonorName|page={{{honorlandingpage|}}}}}}} |
|subheader={{#ifeq:{{#var:honorstate}}|piloting|{{GetHonorName|page={{{honorlandingpage|}}}}}}} | |subheader={{#ifeq:{{#var:honorstate}}|piloting|{{GetHonorName|page={{{honorlandingpage|}}}}}}} | ||
|subheader2=[[AY Honors/{{#var:localCategory}}{{GetLangSuffix}}|{{Localize|{{#var:localCategory}}}}]] | |subheader2=[[AY Honors/{{#var:localCategory}}{{GetLangSuffix}}|{{Localize|{{#var:localCategory}}}}]] | ||
Line 66: | Line 66: | ||
|col1_label1={{Localize|Skill Level}} | |col1_label1={{Localize|Skill Level}} | ||
|col1_data1={{Honor infobox/echoSkillLevel | skill={{{skill|{{GetHonorMetaData|parameter=skill}}}}}}} | |col1_data1={{Honor infobox/echoSkillLevel | skill={{{skill|{{GetHonorMetaData|parameter=skill}}}}}}} | ||
− | |col1_label2={{Localize|Approval authority}} | + | |
− | |col1_data2={{#if:{{{authority|}}}|{{Localize|{{{authority}}}|Authorities}}|{{GetHonorMetaData|parameter=authority}}}} | + | |col1_label2={{#ifeq:{{#var:honorstate}}|piloting||{{Localize|Approval authority}}}} |
− | |col2_label2={{Localize|Year of Introduction}} | + | |col1_data2={{#ifeq:{{#var:honorstate}}|piloting||{{#if:{{{authority|}}}|{{Localize|{{{authority}}}|Authorities}}|{{GetHonorMetaData|parameter=authority}}}}}} |
− | |col2_data2={{#vardefine:localYear|{{{year|{{GetHonorMetaData|language=/en|parameter=year}}}}}}}{{#iferror:{{#expr:1+{{#var:localYear|X}} }}|{{Localize|Unknown}}|{{#var:localYear}} }} | + | |col2_label2={{#ifeq:{{#var:honorstate}}|piloting||{{Localize|Year of Introduction}}}} |
+ | |col2_data2={{#ifeq:{{#var:honorstate}}|piloting||{{#vardefine:localYear|{{{year|{{GetHonorMetaData|language=/en|parameter=year}}}}}}}{{#iferror:{{#expr:1+{{#var:localYear|X}} }}|{{Localize|Unknown}}|{{#var:localYear}} }} }} | ||
|rowclass3=honor-infobox-seeAlso | |rowclass3=honor-infobox-seeAlso | ||
|col1_label3={{Localize|See also}} | |col1_label3={{Localize|See also}} | ||
Line 80: | Line 81: | ||
|col1_class4=honor-infobox-button | |col1_class4=honor-infobox-button | ||
|col1_noDefaultStyle5=true | |col1_noDefaultStyle5=true | ||
− | |col1_data5={{# | + | |col1_data5={{#if:{{#var:locPilotAuthor}}|<htmltag tagname="a" class="btn btn-accent" href="{{fullurl:Special:EmailUser/{{#var:locPilotAuthor}}}}" target="_blank">{{Localize|Contact Pilot Author}}</htmltag>|}} |
|col1_class5=honor-infobox-button | |col1_class5=honor-infobox-button | ||
|col1_noDefaultStyle10=true | |col1_noDefaultStyle10=true |
Latest revision as of 21:51, 28 April 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
- |honorlandingpage=AY Honors/Camping Skills IV
- }}
</div>
Camping Skills IV | |
---|---|
Recreation | |
Skill Level 123 | |
Approval authority General Conference | Year of Introduction 2001 |
See also |