Difference between revisions of "GenreCatNav"
From Sega Retro
(One intermediate revision by the same user not shown) | |||
Line 30: | Line 30: | ||
{| class="toc plainlinks noprint" align="left" | {| class="toc plainlinks noprint" align="left" | ||
|- | |- | ||
− | |class="bottomtemptext" align="left"| '''[[:Category:{{{1}}} games|{{{1}}} games]] by [[Sega Retro:Determining Genre|Genre]]:''' | + | |class="bottomtemptext" align="left" style="text-align:center; padding:0px;"| <div style="margin-top:-5px; margin-bottom:5px;">'''[[:Category:{{{1}}} games|{{{1}}} games]] by [[Sega Retro:Determining Genre|Genre]]:'''</div> |
{{#vardefine:catdata|action games,Genre action.svg,Action; | {{#vardefine:catdata|action games,Genre action.svg,Action; | ||
adventure games,Genre adventure.svg,Adventure; | adventure games,Genre adventure.svg,Adventure; | ||
Line 48: | Line 48: | ||
| {{#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}}}} | ||
− | {{# | + | {{#if:{{ifexists|Category:{{{1}}} {{#var:catname}}}} | {{incvar|j}}<div style="display:inline-block; text-align:center; padding-top:4px; width:76px; {{#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}} | ||
}} | }} | ||
Line 64: | Line 64: | ||
becomes | becomes | ||
{{GenreCatNav|Saturn}} | {{GenreCatNav|Saturn}} | ||
+ | |||
[[Category:Navigational templates]] | [[Category:Navigational templates]] | ||
</noinclude> | </noinclude> |