Difference between revisions of "Template:Honor infobox"

From Pathfinder Wiki
Line 27: Line 27:
 
}}
 
}}
 
</noinclude>
 
</noinclude>
<includeonly>{{#vardefine:master|{{GetMasterCategoryList|category={{{category}}}|master1={{{master1|}}}|master1_group={{{master1_group}}}|master2={{{master2|}}}|master_group2={{{master_group2}}} }} }}{{#vardefine:patch|{{#switch:{{{insignia}}}
+
<includeonly>{{#vardefine:master|{{User:DesignerThan/MySandbox/GetMasterCategories|category={{{category}}}|master1={{{master1|}}}|master1_group={{{master1_group}}}|master2={{{master2|}}}|master_group2={{{master_group2}}} }} }}{{#vardefine:patch|{{#switch:{{{insignia}}}
 
|No Patch.png
 
|No Patch.png
 
|No_Patch.png={{#lst:Localization:All{{GetLangSuffix}}|No Patch}}
 
|No_Patch.png={{#lst:Localization:All{{GetLangSuffix}}|No Patch}}
Line 64: Line 64:
 
{{#if:{{#var:master}}|{{!}}-
 
{{#if:{{#var:master}}|{{!}}-
 
{{!}}colspan="2" id="infobox-part-of" class="infobox-value text-light bg-secondary"  {{!}}<span class="infobox-value-emphasize">{{Localize|Part of}}</span>
 
{{!}}colspan="2" id="infobox-part-of" class="infobox-value text-light bg-secondary"  {{!}}<span class="infobox-value-emphasize">{{Localize|Part of}}</span>
{{#var:master}}
+
{{#vardefine: i | 0 }}<!--
{{#vardefine:locSeeAlso|{{User:DesignerThan/MySandbox/SeeAlso|honorname={{{honorname}}}}}}}
+
get all interesting links for see also into one variable seperated by | -->{{#vardefine:locSeeAlsoAll|{{#var:master}}{{User:DesignerThan/MySandbox/SeeAlso|honorname={{{honorname}}}}}}}{{#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 }} }}
{{#if: {{#var:locSeeAlso}}|
+
}}{{#var:locSeeAlsoLess}}{{#if: {{#var:locSeeAlsoMore}}|
 
<div id="infobox-see-also" class="mw-collapsible mw-collapsed" data-expandtext="show" data-collapsetext="hide"><br>
 
<div id="infobox-see-also" class="mw-collapsible mw-collapsed" data-expandtext="show" data-collapsetext="hide"><br>
{{#var:locSeeAlso}}
+
{{#var:locSeeAlsoMore}}
</div>}}
+
</div>}} }}
 
}}
 
}}
 
|-
 
|-

Revision as of 23:34, 2 February 2021

This template creates an infobox for an honor.

TODO

  • Fix broken things

Example

{{Template:Honor infobox
|honorname=Aboriginal Lore
|skill=1
|year=2001
|category=Arts, Crafts and Hobbies
|authority=General Conference
|insignia=Aboriginallore.png
}}


Aboriginal Lore
Arts, Crafts and Hobbies
[[File:|170px|link=|alt=|]]
Skill Level
123
Approval authority
Year of Introduction

2001

Part of

User:DesignerThan/MySandbox/GetMasterCategoriesUser:DesignerThan/MySandbox/SeeAlso