Difference between revisions of "GenreCatNav"

From Sega Retro

 
(22 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]]:''' {{#switch: {{{1}}}
+
|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>
| SG-1000 = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Table Games|Table]]
+
{{#vardefine:catdata|action games,Genre action.svg,Action;
 
+
adventure games,Genre adventure.svg,Adventure;
| Master System
+
game compilations,Notavailable.svg,Compilation;
| Mega Drive = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Game Compilations|Compilation]] • [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Simulation Games|Simulation]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Table Games|Table]]
+
demo discs,Notavailable.svg,Demo Disc;
 
+
educational games,Genre edu.svg,Educational;
| Game Gear = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Game Compilations|Compilation]] • [[:Category:{{{1}}} Fighting Games|Fighting]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Simulation Games|Simulation]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Table Games|Table]]
+
fighting games,Genre fighting.png,Fighting;
 
+
miscellaneous software,Notavailable.svg,Misc.;
| Mega CD = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Game Compilations|Compilation]] • [[:Category:{{{1}}} Demo Discs|Demo Discs]] • [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Simulation Games|Simulation]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Table Games|Table]]
+
puzzle games,Genre puzzle.svg,Puzzle;
 
+
RPGs,Genre rpg.svg,RPG;
| Sega 32X = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Game Compilations|Compilation]] • [[:Category:{{{1}}} Demo Discs|Demo Discs]] • [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} Fighting Games|Fighting]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Simulation Games|Simulation]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Table Games|Table]]
+
racing games,Genre racing.svg,Racing;
 
+
shoot-'em-up games,Genre shmup.svg,Shooting;
| Pico = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] [[:Category:{{{1}}} Game Compilations|Compilation]] • [[:Category:{{{1}}} Demo Discs|Demo Discs]] • [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} Fighting Games|Fighting]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Simulation Games|Simulation]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Table Games|Table]]
+
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>
  
| Saturn
+
===Examples===
| Dreamcast = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Game Compilations|Compilation]] • [[:Category:{{{1}}} Demo Discs|Demo Discs]] • [[:Category:{{{1}}} Fighting Games|Fighting]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Simulation Games|Simulation]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Table Games|Table]]
 
}}
 
|}{{clear}}
 
<noinclude>
 
<nowiki>{{</nowiki>GenreCatNav|system}}
 
For example,
 
 
  <nowiki>{{</nowiki>GenreCatNav|Mega Drive}}
 
  <nowiki>{{</nowiki>GenreCatNav|Mega Drive}}
 
becomes
 
becomes
Line 29: Line 64:
 
becomes
 
becomes
 
{{GenreCatNav|Saturn}}
 
{{GenreCatNav|Saturn}}
[[Category:Navigational Templates]]
+
 
 +
[[Category:Navigational templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 09:39, 3 November 2022

Genre action.svg

Usage

{{GenreCatNav|system}}

Examples

{{GenreCatNav|Mega Drive}}

becomes

Genre action.svg

and

{{GenreCatNav|Saturn}}

becomes

Genre action.svg