Difference between revisions of "Template:Honor infobox"

From Pathfinder Wiki
m (Reverted edits by DesignerThan (talk) to last revision by W126jep)
Tag: Rollback
(Undo revision 562485 by DesignerThan (talk))
Tag: Undo
Line 3: Line 3:
  
 
==Mechanics==
 
==Mechanics==
The mechanics are just opaque magic (sorry). And Examples won't work because the template gets the honorname from the page title.
+
The mechanics are just opaque magic (sorry).
  
 
==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/>
::|honorname=Camping Skills IV<br/>
+
::|honorlandingpage=AY Honors/Camping Skills IV<br/>
 
::|skill=2<br/>
 
::|skill=2<br/>
 
::|year=2001<br/>
 
::|year=2001<br/>
Line 17: Line 18:
 
::|master1=Wilderness<br/>
 
::|master1=Wilderness<br/>
 
:}}
 
:}}
:<nowiki>{{</nowiki>Honor infobox<br/>
+
<nowiki></div></nowiki>
::|honorname=Camping Skills IV
+
</div>
:}}
+
<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 30: Line 40:
 
}}|{{#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">
{| class="honor-infobox" style="table-layout: fixed; width: 100%;"
+
{{Infobox
|-
+
|bodyclass=honor-infobox
|colspan="2"  id="infobox-title"|{{GetHonorName}}
+
|above={{GetHonorName|page={{{honorlandingpage|}}}}}
|-
+
|subheader=[[AY Honors/{{#var:localCategory}}{{GetLangSuffix}}|{{Localize|{{#var:localCategory}}}}]]
| colspan="2" |[[AY Honors/{{#var:localCategory}}{{GetLangSuffix}}|{{Localize|{{#var:localCategory}}}}]]
+
|image={{#if:{{{insignia_source|{{GetHonorMetaData|language=/en|parameter=insignia_source}}}}}
|-
 
|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 = {{#lst:Localization:All{{GetLangSuffix}}|Not available at AdventSource}}
+
       | float = {{Localize|Not available at AdventSource}}
 
       | float_width = 170px
 
       | float_width = 170px
 
       | align=center
 
       | align=center
Line 55: Line 62:
 
     }}
 
     }}
 
}}
 
}}
|-
+
|col1_label1={{Localize|Skill Level}}
| 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_data1={{Honor infobox/echoSkillLevel | skill={{{skill|{{GetHonorMetaData|parameter=skill}}}}}}}
|-
+
|col1_label2={{Localize|Approval 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}}}}
+
|col1_data2={{#if:{{{authority|}}}|{{Localize|{{{authority}}}|Authorities}}|{{GetHonorMetaData|parameter=authority}}}}
| class="infobox-value text-light bg-secondary" | <span class="infobox-value-emphasize">{{Localize|Year of Introduction}}</span><br>
+
|col2_label2={{Localize|Year of Introduction}}
{{#vardefine:localYear|{{{year|{{GetHonorMetaData|language=/en|parameter=year}}}}}}}{{#iferror:{{#expr:1+{{#var:localYear|X}} }}|{{Localize|Unknown}}|{{#var:localYear}} }}
+
|col2_data2={{#vardefine:localYear|{{{year|{{GetHonorMetaData|language=/en|parameter=year}}}}}}}{{#iferror:{{#expr:1+{{#var:localYear|X}} }}|{{Localize|Unknown}}|{{#var:localYear}} }}
{{#if:{{#var:locSeeAlsoLess}}|{{!}}-
+
|rowclass3=honor-infobox-seeAlso
{{!}}colspan="2" id="infobox-part-of" class="infobox-value text-light bg-secondary"  {{!}}<span class="infobox-value-emphasize">{{Localize|See also}}</span><br>
+
|col1_label3={{Localize|See also}}
{{#var:locSeeAlsoLess}}{{#if: {{#var:locSeeAlsoMore}}|
+
|col1_data3={{#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>}}
{{#ifsysop:{{!}}-
+
|col1_noDefaultStyle4=true
{{!}} 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}}
+
|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}}
 
</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>|}}
|}</div>
+
|col1_class4=honor-infobox-button
 +
}}
 +
</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).

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