Difference between revisions of "GenreCatNav"
From Sega Retro
(future proofing) |
|||
(20 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | <div style="display:none;">{{#vardefine:genre|{{#if:{{#pos:{{PAGENAME}}|action}}|action|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|adventure}}|adventure|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|compilations}}|compilation|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|demo discs}}|demo|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|educational}}|educational|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|fighting}}|fighting|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|miscellaneous}}|miscellaneous|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|puzzle}}|puzzle|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|RPGs}}|RPGs|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|racing}}|racing|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|shoot}}|shoot|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|simulation}}|simulation|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|sports}}|sports|{{ | ||
+ | #if:{{#pos:{{PAGENAME}}|table}}|table|}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{{#switch:{{#var:genre}}| | ||
+ | |action={{#vardefine:icon|Genre action.svg}}{{#vardefine:category|action games}} | ||
+ | |adventure={{#vardefine:icon|Genre adventure.svg}}{{#vardefine:category|adventure games}} | ||
+ | |compilation={{#vardefine:icon|}}{{#vardefine:category|game compilations}} | ||
+ | |demo={{#vardefine:icon|}}{{#vardefine:category|demo discs}} | ||
+ | |educational={{#vardefine:icon|Genre edu.svg}}{{#vardefine:category|educational games}} | ||
+ | |fighting={{#vardefine:icon|Genre fighting.png}}{{#vardefine:category|fighting games}} | ||
+ | |miscellaneous={{#vardefine:icon|}}{{#vardefine:category|miscellaneous software}} | ||
+ | |puzzle={{#vardefine:icon|Genre puzzle.svg}}{{#vardefine:category|puzzle games}} | ||
+ | |RPGs={{#vardefine:icon|Genre rpg.svg}}{{#vardefine:category|RPGs}} | ||
+ | |racing={{#vardefine:icon|Genre racing.svg}}{{#vardefine:category|racing games}} | ||
+ | |shoot={{#vardefine:icon|Genre shmup.svg}}{{#vardefine:category|shoot-'em-up games}} | ||
+ | |simulation={{#vardefine:icon|Genre simulation.svg}}{{#vardefine:category|simulation games}} | ||
+ | |sports={{#vardefine:icon|Genre sports.svg}}{{#vardefine:category|sports games}} | ||
+ | |table={{#vardefine:icon|Genre home.png}}{{#vardefine:category|table games}} | ||
+ | }}</div>{{#if:{{#var:icon}}|[[File:{{#var:icon}}|right|200px]]}}{{#ifeq:{{NAMESPACE}}|Category|[[Category:{{#var:category}}]][[Category:{{{1}}} games by genre]]}} | ||
{| 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; |
− | + | adventure games,Genre adventure.svg,Adventure; | |
− | + | game compilations,Notavailable.svg,Compilation; | |
− | + | demo discs,Notavailable.svg,Demo Disc; | |
− | + | educational games,Genre edu.svg,Educational; | |
− | | | + | fighting games,Genre fighting.png,Fighting; |
− | + | miscellaneous software,Notavailable.svg,Misc.; | |
− | | | + | puzzle games,Genre puzzle.svg,Puzzle; |
− | + | RPGs,Genre rpg.svg,RPG; | |
− | + | racing games,Genre racing.svg,Racing; | |
− | + | shoot-'em-up games,Genre shmup.svg,Shooting; | |
− | | | + | simulation games,Genre simulation.svg,Simulation; |
+ | sports games,Genre sports.svg,Sport; | ||
+ | table games,Genre home.png,Table | ||
+ | }}{{#vardefine:i|0}}{{#vardefine:j|0}}{{#while: | ||
+ | | {{#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}}}} | ||
+ | {{#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}} | ||
+ | }} | ||
+ | |} | ||
+ | {{clear}}<noinclude> | ||
+ | ==Usage== | ||
+ | <pre>{{GenreCatNav|system}}</pre> | ||
− | + | ===Examples=== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<nowiki>{{</nowiki>GenreCatNav|Mega Drive}} | <nowiki>{{</nowiki>GenreCatNav|Mega Drive}} | ||
becomes | becomes | ||
Line 29: | Line 64: | ||
becomes | becomes | ||
{{GenreCatNav|Saturn}} | {{GenreCatNav|Saturn}} | ||
− | [[Category:Navigational | + | |
+ | [[Category:Navigational templates]] | ||
</noinclude> | </noinclude> |