Difference between revisions of "Template:Video game category header"

From Yugipedia
Jump to: navigation, search
(I *really* hate that bug)
(add support for a few different subcategory types)
Line 1: Line 1:
This category contains pages related to the video game ''[[{{PAGENAME}}|{{ #if: 1 | {{ #explode: {{PAGENAME}} | ( }} }}]]''.
+
{{ #vardefine: $type | {{ #explode: {{PAGENAME}} || -1 }}
 +
}}{{ #switch: {{ #var: $type }}
 +
| characters | cards | files | images | sets = {{ #vardefine: $game | {{ #explode: {{PAGENAME}} | {{ #var: $type }} }} }}
 +
| #default = {{ #vardefine: $game | {{PAGENAME}} }}{{ #vardefine: $type }}
 +
}}{{ #vardefine: $game_short | {{ #switch: {{ #explode: {{PAGENAME}} || 1 }}
 +
  | GX      = {{ #replace: {{ #var: $game }} | Yu-Gi-Oh! GX }}
 +
  | 5D's = {{ #replace: {{ #var: $game }} | Yu-Gi-Oh! 5D's }}
 +
  | ZEXAL    = {{ #replace: {{ #var: $game }} | Yu-Gi-Oh! ZEXAL }}
 +
  | The      = {{ #replace: {{ #var: $game }} | Yu-Gi-Oh! The }}
 +
  | #default = {{ #replace: {{ #var: $game }} | Yu-Gi-Oh! }}
 +
  }}
 +
}}{{ #vardefine: $game_pretty | {{ #explode: {{ #var: $game }} | ( }}
 +
}}This category contains pages related to {{ #if: {{ #var: $type }} | {{ #var: $type }} in }} the video game ''[[{{PAGENAME}}|{{ #var: $game_pretty }}]]''.
  
<includeonly>[[Category:Video games|{{
+
<includeonly>{{ #if: {{ #var: $type }} | [[Category:{{ #var: $game }}]] }}[[Category:Video games|{{ #var: $game_short }}]]</includeonly><noinclude>[[Category:Templates]]</noinclude>
  #switch: {{ #explode: {{PAGENAME}} || 1 }}
 
  | GX      = {{ #replace: {{PAGENAME}} | Yu-Gi-Oh! GX }}
 
  | 5D&#39;s = {{ #replace: {{PAGENAME}} | Yu-Gi-Oh! 5D&#39;s }}
 
  | ZEXAL    = {{ #replace: {{PAGENAME}} | Yu-Gi-Oh! ZEXAL }}
 
  | The      = {{ #replace: {{PAGENAME}} | Yu-Gi-Oh! The }}
 
  | #default = {{ #replace: {{PAGENAME}} | Yu-Gi-Oh! }}
 
}}]]</includeonly><noinclude>[[Category:Templates]]</noinclude>
 

Revision as of 13:18, 23 October 2019

This category contains pages related to the video game Video game category header.