Difference between revisions of "Template:Honor infobox"

From Pathfinder Wiki
m (Reverted edits by DesignerThan (talk) to last revision by W126jep)
Tag: Rollback
Line 3: Line 3:
  
 
==Mechanics==
 
==Mechanics==
The mechanics are just opaque magic (sorry).
+
The mechanics are just opaque magic (sorry). And Examples won't work because the template gets the honorname from the page title.
  
 
==Example== <!--T:3-->
 
==Example== <!--T:3-->
 
<div class="toccolours">
 
<div class="toccolours">
<nowiki><div style="max-width: 300px"></nowiki>
 
 
:<nowiki>{{</nowiki>Honor infobox<br/>
 
:<nowiki>{{</nowiki>Honor infobox<br/>
::|honorlandingpage=AY Honors/Camping Skills IV<br/>
+
::|honorname=Camping Skills IV<br/>
 
::|skill=2<br/>
 
::|skill=2<br/>
 
::|year=2001<br/>
 
::|year=2001<br/>
Line 18: Line 17:
 
::|master1=Wilderness<br/>
 
::|master1=Wilderness<br/>
 
:}}
 
:}}
<nowiki></div></nowiki>
+
:<nowiki>{{</nowiki>Honor infobox<br/>
</div>
+
::|honorname=Camping Skills IV
<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>
 
</div>
 +
 
<!--T:4-->
 
<!--T:4-->
 
[[Category:UsesLoops]]</noinclude>
 
[[Category:UsesLoops]]</noinclude>
Line 40: Line 30:
 
}}|{{#lst:Localization:All{{GetLangSuffix}}|No Patch}}}}}}
 
}}|{{#lst:Localization:All{{GetLangSuffix}}|No Patch}}}}}}
 
<templatestyles src="Honor infobox/style.css" /><div class="mw-parser-output noprint">
 
<templatestyles src="Honor infobox/style.css" /><div class="mw-parser-output noprint">
{{Infobox
+
{| class="honor-infobox" style="table-layout: fixed; width: 100%;"
|bodyclass=honor-infobox
+
|-
|above={{GetHonorName|page={{{honorlandingpage|}}}}}
+
|colspan="2"  id="infobox-title"|{{GetHonorName}}
|subheader=[[AY Honors/{{#var:localCategory}}{{GetLangSuffix}}|{{Localize|{{#var:localCategory}}}}]]
+
|-
|image={{#if:{{{insignia_source|{{GetHonorMetaData|language=/en|parameter=insignia_source}}}}}
+
| colspan="2" |[[AY Honors/{{#var:localCategory}}{{GetLangSuffix}}|{{Localize|{{#var:localCategory}}}}]]
 +
|-
 +
|colspan="2" style="padding: .5rem 2rem;"|
 +
{{#if:{{{insignia_source|{{GetHonorMetaData|language=/en|parameter=insignia_source}}}}}
 
   |{{Superimpose
 
   |{{Superimpose
 
       | base = {{#var:patch}}
 
       | base = {{#var:patch}}
 
       | base_width = 100%
 
       | base_width = 100%
 
       | base_max_width = 150px
 
       | base_max_width = 150px
       | float = {{Localize|Not available at AdventSource}}
+
       | float = {{#lst:Localization:All{{GetLangSuffix}}|Not available at AdventSource}}
 
       | float_width = 170px
 
       | float_width = 170px
 
       | align=center
 
       | align=center
Line 62: Line 55:
 
     }}
 
     }}
 
}}
 
}}
|col1_label1={{Localize|Skill Level}}
+
|-
|col1_data1={{Honor infobox/echoSkillLevel | skill={{{skill|{{GetHonorMetaData|parameter=skill}}}}}}}
+
| colspan="2" class="infobox-value text-light bg-secondary" |<span class="infobox-value-emphasize">{{Localize|Skill Level}}</span><br>{{Honor infobox/echoSkillLevel | skill={{{skill|{{GetHonorMetaData|parameter=skill}}}}}}}
|col1_label2={{Localize|Approval authority}}
+
|-
|col1_data2={{#if:{{{authority|}}}|{{Localize|{{{authority}}}|Authorities}}|{{GetHonorMetaData|parameter=authority}}}}
+
| class="infobox-value text-light bg-secondary" | <span class="infobox-value-emphasize">{{Localize|Approval authority}}</span><br>{{#if:{{{authority|}}}|{{Localize|{{{authority}}}|Authorities}}|{{GetHonorMetaData|parameter=authority}}}}
|col2_label2={{Localize|Year of Introduction}}
+
| class="infobox-value text-light bg-secondary" | <span class="infobox-value-emphasize">{{Localize|Year of Introduction}}</span><br>
|col2_data2={{#vardefine:localYear|{{{year|{{GetHonorMetaData|language=/en|parameter=year}}}}}}}{{#iferror:{{#expr:1+{{#var:localYear|X}} }}|{{Localize|Unknown}}|{{#var:localYear}} }}
+
{{#vardefine:localYear|{{{year|{{GetHonorMetaData|language=/en|parameter=year}}}}}}}{{#iferror:{{#expr:1+{{#var:localYear|X}} }}|{{Localize|Unknown}}|{{#var:localYear}} }}
|rowclass3=honor-infobox-seeAlso
+
{{#if:{{#var:locSeeAlsoLess}}|{{!}}-
|col1_label3={{Localize|See also}}
+
{{!}}colspan="2" id="infobox-part-of" class="infobox-value text-light bg-secondary"  {{!}}<span class="infobox-value-emphasize">{{Localize|See also}}</span><br>
|col1_data3={{#var:locSeeAlsoLess}}{{#if: {{#var:locSeeAlsoMore}}|
+
{{#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>}} }}
|col1_noDefaultStyle4=true
+
{{#ifsysop:{{!}}-
|col1_data4={{#ifsysop:<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}}
 
</htmltag><htmltag tagname="a" href="{{fullurl:{{#titleparts:{{PAGENAME}}|2|1}}/Answer Key{{GetLangSuffix}}|action=mpdf}}" class="dropdown-item">{{Localize|Answer Key}}</htmltag></div></div>|}}
 
</htmltag><htmltag tagname="a" href="{{fullurl:{{#titleparts:{{PAGENAME}}|2|1}}/Answer Key{{GetLangSuffix}}|action=mpdf}}" class="dropdown-item">{{Localize|Answer Key}}</htmltag></div></div>|}}
|col1_class4=honor-infobox-button
+
|}</div>
}}
 
</div>
 
 
</includeonly>
 
</includeonly>

Revision as of 04:39, 30 January 2022

This template creates an infobox for an honor.

Mechanics

The mechanics are just opaque magic (sorry). And Examples won't work because the template gets the honorname from the page title.

Example

{{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
}}
{{Honor infobox
|honorname=Camping Skills IV
}}