Difference between revisions of "Template:Honor index2"
From Pathfinder Wiki
DesignerThan (talk | contribs) |
|||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | <!--- ¦ ---> | + | <!--- ¦ ---><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}} }} }} }} | ||
− | |||
{{#dpl: | {{#dpl: | ||
|debug=0 | |debug=0 | ||
− | |include={honor_landing}: | + | |include={honor_landing}{{#var: selectedcolumns }} |
− | |table=class="wikitable sortable",- | + | |table=class="wikitable sortable",-{{#var: tableheader }} |
− | |tablerow= | + | |tablerow={{#var: tablerow}} |
|category={{#var:argIncCat}} | |category={{#var:argIncCat}} | ||
− | {{# | + | |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