Difference between revisions of "Template:Honor index2"

From Pathfinder Wiki
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!--- ¦ --->
+
<!--- ¦ ---><includeonly>
<includeonly>
+
<!-- assamble the tablerow argument of DPL so it is customizeable -->
 +
<!-- initialize the variables -->
 +
{{#vardefine: selectedcolumns | }}{{#vardefine: selectedcolumns | {{#if: {{{columnselection|}}} | {{{columnselection}}} | :honorname:insignia:category:authority:skill:year }} }}{{#vardefine: tablerow | }}{{#vardefine: tableheader | }}
 +
{{#vardefine: i | 1 }}{{#while: <!-- we need to start at word 1 because of the leeding : -->
 +
| {{#if: {{#explode:{{#var: selectedcolumns }}|:|{{#var: i }}}} | true }}
 +
| {{#vardefine: tablerow | {{#var: tablerow}}{{#switch: {{#explode:{{#var: selectedcolumns }}|:|{{#var: i }}}} | honorname = [[%PAGE%¦%%]], | insignia = [[File:%%¦30px¦center]], | category = align="left"¦²{Localize¦%%}², | authority = align="center"¦²{division honor¦²{division abbrev¦%%}²}², | skill = align="center"¦%%, | year = align="center"¦%%, }} }}
 +
{{#vardefine: tableheader | {{#var: tableheader}}{{#switch: {{#explode:{{#var: selectedcolumns }}|:|{{#var: i }}}} | honorname = ,{{Localize|Honor}} | insignia = ,{{Localize|Patch}} | category = ,{{Localize|Category}} | authority = ,{{Localize|Approval}} | skill = ,{{Localize|Skill Level}} | year = ,{{Localize|Year}} }} }}{{#vardefine: i | {{#expr: {{#var: i }} + 1 }} }} }}<nowiki />
 
<!-- that loop's through all argument's with the prefix cat and saves it into a variable -->
 
<!-- that loop's through all argument's with the prefix cat and saves it into a variable -->
 
{{#vardefine:argIncCat|AY Honors/Honor landing{{GetLangSuffix}}&AY Honors/Primary}}{{#forargs: cat | key | category |<nowiki />{{#vardefine: argIncCat |{{#var:argIncCat}}{{#if:{{#var:category}}|&{{#var:category}}{{GetLangSuffix}} }} }} }}
 
{{#vardefine:argIncCat|AY Honors/Honor landing{{GetLangSuffix}}&AY Honors/Primary}}{{#forargs: cat | key | category |<nowiki />{{#vardefine: argIncCat |{{#var:argIncCat}}{{#if:{{#var:category}}|&{{#var:category}}{{GetLangSuffix}} }} }} }}
{{#vardefine:argExcCat|¦notcategory=AY Honors/Secondary}}{{#forargs: excat | exkey | excategory |<nowiki />{{#vardefine: argExcCat |{{#var:argExcCat}}{{#if:{{#var:excategory}}|{{!}}notcategory={{#var:excategory}}{{GetLangSuffix}} }} }} }}
 
 
{{#dpl:
 
{{#dpl:
 
|debug=0
 
|debug=0
|include={honor_landing}:honorname:insignia:category:authority:skill:year
+
|include={honor_landing}{{#var: selectedcolumns }}
|table=class="wikitable sortable",-,{{Localize|Honor}},{{Localize|Patch}},{{Localize|Category}},{{Localize|Approval}},{{Localize|Skill Level}},{{Localize|Year}}
+
|table=class="wikitable sortable",-{{#var: tableheader }}
|tablerow=[[%PAGE%¦%%]],[[File:%%¦30px¦center]],align="left"¦²{Localize¦%%}²,align="center"¦²{division honor¦²{division abbrev¦%%}²}²,align="center"¦%%,align="center"¦%%
+
|tablerow={{#var: tablerow}}
 
|category={{#var:argIncCat}}
 
|category={{#var:argIncCat}}
{{#var:argExcCat}}
+
|notcategory={{#if:{{{excat1|}}}|{{{excat1}}}{{GetLangSuffix}}}}
 +
|notcategory={{#if:{{{excat2|}}}|{{{excat2}}}{{GetLangSuffix}}}}
 +
|notcategory={{#if:{{{excat3|}}}|{{{excat3}}}{{GetLangSuffix}}}}
 +
|notcategory={{#if:{{{excat4|}}}|{{{excat4}}}{{GetLangSuffix}}}}
 +
|notcategory={{#if:{{{excat5|}}}|{{{excat5}}}{{GetLangSuffix}}}}
 
|nottitleregexp=.*/en$
 
|nottitleregexp=.*/en$
 
|ordermethod=sortkey
 
|ordermethod=sortkey
Line 17: Line 26:
 
</includeonly>
 
</includeonly>
 
<noinclude><nowiki />{{Honor index2
 
<noinclude><nowiki />{{Honor index2
 +
|cat1=AY Honors/Arts, Crafts and Hobbies
 +
|cat2=AY Honors/Skill Level 1
 +
|excat1=AY Honors/Approved by General Conference
 +
|excat2=AY Honors/Approved by North American Division
 +
|columnselection=:honorname:insignia:authority:skill:year
 +
}}<nowiki />{{Honor index2
 
|cat1=AY Honors/Arts, Crafts and Hobbies
 
|cat1=AY Honors/Arts, Crafts and Hobbies
 
|cat2=AY Honors/Skill Level 1
 
|cat2=AY Honors/Skill Level 1
Line 22: Line 37:
 
|excat2=AY Honors/Approved by North American Division
 
|excat2=AY Honors/Approved by North American Division
 
}}
 
}}
</noinclude>
+
[[Category:UsesLoops]]</noinclude>

Latest revision as of 00:22, 18 March 2021