Difference between revisions of "GenreCatNav"

From Sega Retro

 
(57 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{| class="bottomtemplate" align="left"
+
<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="bottomtemptext" align="left" |'''[[:Category:{{{1}}} Games|{{{1}}} Games]] by [[Sega Retro:Determining Genre|Genre]]:''' [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} RPG Games|RPG]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Strategy Games|Strategy]]
+
|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}}
 +
}}
 
|}
 
|}
<br clear="all">
+
{{clear}}<noinclude>
<noinclude>
+
==Usage==
<nowiki>{{</nowiki>GenreCatNav|system}}
+
<pre>{{GenreCatNav|system}}</pre>
For example,
+
 
 +
===Examples===
 
  <nowiki>{{</nowiki>GenreCatNav|Mega Drive}}
 
  <nowiki>{{</nowiki>GenreCatNav|Mega Drive}}
 
becomes
 
becomes
{{User:Andlabs/Template:GenreCatNav|Mega Drive}}
+
{{GenreCatNav|Mega Drive}}
 
and
 
and
 
  <nowiki>{{</nowiki>GenreCatNav|Saturn}}
 
  <nowiki>{{</nowiki>GenreCatNav|Saturn}}
 
becomes
 
becomes
{{User:Andlabs/Template:GenreCatNav|Saturn}}
+
{{GenreCatNav|Saturn}}
[[Category:Navigational Templates]]
+
 
 +
[[Category:Navigational templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 08: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