Difference between revisions of "Template:Honor infobox"

From Pathfinder Wiki
(optimized the see more code. the see more section is now not visible if there is no content for it)
Line 27: Line 27:
 
|insignia=Camping_Skills_IV.png
 
|insignia=Camping_Skills_IV.png
 
|insignia_source=foo
 
|insignia_source=foo
|master1=Wilderness
+
}}
 +
{{{{FULLPAGENAME}}
 +
|honorname=Rock Climbing
 +
|skill=2
 +
|year=1970
 +
|category=Recreation
 +
|authority=North American Division
 +
|insignia=Rock_Climbing_Honor.png
 +
|insignia_source=foo
 
}}
 
}}
 
</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><!-- Get the List of Master Honors -->{{#vardefine:master|{{GetMasterCategoryList|category={{{category}}}|master1={{{master1|}}}|master1_group={{{master1_group}}}|master2={{{master2|}}}|master_group2={{{master_group2}}} }} }}<!-- 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 seperated by | -->{{#vardefine:locSeeAlsoAll|{{#var:master}}{{See Also|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 }} }} }} }}<!-- get the patch -->{{#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 65: Line 73:
 
| class="infobox-value text-light bg-secondary" | <span class="infobox-value-emphasize">{{Localize|Year of Introduction}}</span><br>
 
| class="infobox-value text-light bg-secondary" | <span class="infobox-value-emphasize">{{Localize|Year of Introduction}}</span><br>
 
{{#iferror:{{#expr:1+{{{year|X}}} }}|{{Localize|Unknown}}|{{{year}}} }}
 
{{#iferror:{{#expr:1+{{{year|X}}} }}|{{Localize|Unknown}}|{{{year}}} }}
{{#if:{{#var:master}}|{{!}}-
+
{{#if:{{#var:locSeeAlsoLess}}|{{!}}-
 
{{!}}colspan="2" id="infobox-part-of" class="infobox-value text-light bg-secondary"  {{!}}<span class="infobox-value-emphasize">{{Localize|See also}}</span><br>
 
{{!}}colspan="2" id="infobox-part-of" class="infobox-value text-light bg-secondary"  {{!}}<span class="infobox-value-emphasize">{{Localize|See also}}</span><br>
{{#vardefine: i | 0 }}<!--
+
{{#var:locSeeAlsoLess}}{{#if: {{#var:locSeeAlsoMore}}|
get all interesting links for see also into one variable seperated by | -->{{#vardefine:locSeeAlsoAll|{{#var:master}}{{See Also|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 }} }}
 
}}{{#var:locSeeAlsoLess}}{{#if: {{#var:locSeeAlsoMore}}|
 
 
<div id="infobox-see-also" class="mw-collapsible mw-collapsed" data-expandtext="{{Localize|More}}" data-collapsetext="{{Localize|Less}}"><br>
 
<div id="infobox-see-also" class="mw-collapsible mw-collapsed" data-expandtext="{{Localize|More}}" data-collapsetext="{{Localize|Less}}"><br>
 
{{#var:locSeeAlsoMore}}
 
{{#var:locSeeAlsoMore}}
 
</div>}} }}
 
</div>}} }}
}}
 
 
|-
 
|-
 
| colspan="2" |<div class="dropdown"><htmltag tagname="button" class="btn btn-accent dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{Localize|Downloads}}</htmltag><div class="dropdown-menu" aria-labelledby="dropdownMenuButton"><htmltag tagname="a" href="{{fullurl:{{#titleparts:{{PAGENAME}}|2|1}}/Requirements{{GetLangSuffix}}|action=mpdf}}" class="dropdown-item">{{Localize|Requirements}}
 
| colspan="2" |<div class="dropdown"><htmltag tagname="button" class="btn btn-accent dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{Localize|Downloads}}</htmltag><div class="dropdown-menu" aria-labelledby="dropdownMenuButton"><htmltag tagname="a" href="{{fullurl:{{#titleparts:{{PAGENAME}}|2|1}}/Requirements{{GetLangSuffix}}|action=mpdf}}" class="dropdown-item">{{Localize|Requirements}}

Revision as of 01:11, 5 February 2021

This template creates an infobox for an honor.

TODO

  • Fix broken things

Example

{{Template:Honor infobox
|honorname=Camping Skills IV
|skill=2
|year=2001
|category=Recreation
|authority=General Conference
|insignia=Camping_Skills_IV.png
|insignia_source=foo
|master1=Wilderness
}}


Camping Skills IV
Recreation
[[File:|170px|link=|alt=|]]
Skill Level
123
Approval authority
Year of Introduction

2001

See also

Camp Safety - Advanced
Outdoor Leadership
Camping Skills III


Rock Climbing
Recreation
[[File:|170px|link=|alt=|]]
Skill Level
123
Approval authority
Year of Introduction

1970

See also

Rock Climbing - Advanced