Difference between revisions of "GenreCatNav"
From Sega Retro
(so it matches the others ;)) |
|||
Line 19: | Line 19: | ||
| {{#ifexpr: {{#len:{{#explode:{{#var:catdata}}|;|{{#var:i}}}}}} > 0 | true }} | | {{#ifexpr: {{#len:{{#explode:{{#var:catdata}}|;|{{#var:i}}}}}} > 0 | true }} | ||
| {{#vardefine:catdatasub|{{#explode:{{#var:catdata}}|;|{{#var:i}}}}}}{{#vardefine:catname|{{#explode:{{#var:catdatasub}}|,|0}}}}{{#vardefine:catimg|{{#explode:{{#var:catdatasub}}|,|1}}}}{{#vardefine:catshort|{{#explode:{{#var:catdatasub}}|,|2}}}} | | {{#vardefine:catdatasub|{{#explode:{{#var:catdata}}|;|{{#var:i}}}}}}{{#vardefine:catname|{{#explode:{{#var:catdatasub}}|,|0}}}}{{#vardefine:catimg|{{#explode:{{#var:catdatasub}}|,|1}}}}{{#vardefine:catshort|{{#explode:{{#var:catdatasub}}|,|2}}}} | ||
− | {{#ifexist: Category:{{{1}}} {{#var:catname}} | {{incvar|j}}<div style="display:inline-block; text-align:center; padding-top:4px; width:70px; {{#ifeq: {{#expr:{{#var:j}} mod 2}} | 1 | background: | + | {{#ifexist: Category:{{{1}}} {{#var:catname}} | {{incvar|j}}<div style="display:inline-block; text-align:center; padding-top:4px; width:70px; {{#ifeq: {{#expr:{{#var:j}} mod 2}} | 1 | background:#DDDDDD;}}">[[File:{{#var:catimg}}|40px|link=Category:{{{1}}} {{#var:catname}}]]<br>[[:Category:{{{1}}} {{#var:catname}}|{{#var:catshort}}]]<br>{{PAGESINCATEGORY:{{{1}}} {{#var:catname}}}} pages</div> }} |
{{incvar|i}} | {{incvar|i}} | ||
}} | }} |
Revision as of 15:30, 6 July 2018
Usage
{{GenreCatNav|system}}
Examples
{{GenreCatNav|Mega Drive}}
becomes
and
{{GenreCatNav|Saturn}}
becomes