Difference between revisions of "Template:Search categories"

From Yugipedia
Jump to: navigation, search
(cache each unlinked item so {{unlink}} only gets run once on the item (thus reducing the number of times it's run per transclusion by half); make everything not break when SMW breaks/is disabled)
(automatically apply "Can be Special Summoned"/"Can always be Special Summoned" values for Property:Summoning (this required the addition of three more parameters, though =/ ))
Line 49: Line 49:
 
: [[{{ #vardefineecho: $uel | {{unlink|$el}} }}|{{ #explode: {{ #var: $uel }} | ( }}]][[MonsterSpellTrap::{{ #var: $uel }}| ]] }}
 
: [[{{ #vardefineecho: $uel | {{unlink|$el}} }}|{{ #explode: {{ #var: $uel }} | ( }}]][[MonsterSpellTrap::{{ #var: $uel }}| ]] }}
 
</div>
 
</div>
}} }}{{ #if: {{{summoning<includeonly>|</includeonly>}}} | {{ #if: {{not|{{ #pos: {{{summoning}}} | No Entry }}}} |<!-- this one needs work to support the auto-"Can be Special Summoned", etc. stuff -->
+
}} }}{{ #if: {{{summoning<includeonly>|</includeonly>}}} | {{ #if: {{not|{{ #pos: {{{summoning}}} | No Entry }}}} |
 
<div class="hlist">
 
<div class="hlist">
 
; Summoning categories {{ #arraydefine: $search_array | {{{summoning}}} | * | unique }}{{ #arrayprint: $search_array || $el | <nowiki/>
 
; Summoning categories {{ #arraydefine: $search_array | {{{summoning}}} | * | unique }}{{ #arrayprint: $search_array || $el | <nowiki/>
 
: [[{{ #vardefineecho: $uel | {{unlink|$el}} }}|{{ #explode: {{ #var: $uel }} | ( }}]][[Summoning::{{ #var: $uel }}| ]] }}
 
: [[{{ #vardefineecho: $uel | {{unlink|$el}} }}|{{ #explode: {{ #var: $uel }} | ( }}]][[Summoning::{{ #var: $uel }}| ]] }}
</div>
+
</div>{{ #if: {{{monster|}}}
}} }}{{ #if: {{{attack<includeonly>|</includeonly>}}} | {{ #if: {{not|{{ #pos: {{{attack}}} | No Entry }}}} |
+
  | {{ #if: {{{token|}}}
 +
    || {{ #arraydefine: @summons | {{{summoning}}} | * }}{{ #if: {{ #arraysearch: @summons | /Nomi/i }}
 +
      || {{ #if: {{ #arraysearch: @summons | /Cannot Special Summon/i }}{{ #arraysearch: @summons | /Cannot be Special Summoned/i }}
 +
        || [[Summoning::Can be Special Summoned| ]]{{ #if: {{ #arraysearch: @summons | /Semi[ -]?Nomi/i }}{{{monster_type|}}}
 +
          || [[Summoning::Can always be Special Summoned| ]]
 +
          }}
 +
        }}
 +
      }}
 +
    }}
 +
  }}
 +
| {{ #if: {{{monster|}}} | {{ #if: {{{token|}}} || [[Summoning::Can be Special Summoned| ]]{{ #if: {{{monster_type|}}} || [[Summoning::Can always be Special Summoned| ]] }} }} }}
 +
}}
 +
| {{ #if: {{{monster|}}} | {{ #if: {{{token|}}} || [[Summoning::Can be Special Summoned| ]]{{ #if: {{{monster_type|}}} || [[Summoning::Can always be Special Summoned| ]] }} }} }}
 +
}}{{ #if: {{{attack<includeonly>|</includeonly>}}} | {{ #if: {{not|{{ #pos: {{{attack}}} | No Entry }}}} |
 
<div class="hlist">
 
<div class="hlist">
 
; Attack categories {{ #arraydefine: $search_array | {{{attack}}} | * | unique }}{{ #arrayprint: $search_array || $el | <nowiki/>
 
; Attack categories {{ #arraydefine: $search_array | {{{attack}}} | * | unique }}{{ #arrayprint: $search_array || $el | <nowiki/>
Line 92: Line 105:
 
==Search categories==
 
==Search categories==
 
   {{Search categories
 
   {{Search categories
 +
  | monster                  = <!-- parameters/checks to determine if the card is a monster, e.g. {{ #if: {{{atk|}}}{{{def|}}}{{ #var: $stars }} }} -->
 +
  | monster_type            = <!-- check to see if the monster is a type that can't always be Special Summoned: Fusion, Ritual, Synchro, or Xyz -->
 +
  | token                    = <!-- check to see if the monster is a token -->
 
   | supports                = {{{supports<includeonly>|</includeonly>}}}
 
   | supports                = {{{supports<includeonly>|</includeonly>}}}
 
   | anti-supports            = {{{anti-supports<includeonly>|</includeonly>}}}
 
   | anti-supports            = {{{anti-supports<includeonly>|</includeonly>}}}

Revision as of 09:06, 30 December 2015

Supports
[[{{{supports}}}|{{{supports}}}]]
Anti-supports
[[{{{anti-supports}}}|{{{anti-supports}}}]]
Archetypes and series
[[{{{archseries}}}|{{{archseries}}}]]
Supports archetypes
[[{{{supports_archetypes}}}|{{{supports_archetypes}}}]]
Anti-supports archetypes
[[{{{anti-supports_archetypes}}}|{{{anti-supports_archetypes}}}]]
Related to archetypes and series
[[{{{related_to_archseries}}}|{{{related_to_archseries}}}]]
Counters
[[{{{counter}}}|{{{counter}}}]]
Actions
[[{{{action}}}|{{{action}}}]]
Stat changes
[[{{{stat_change}}}|{{{stat_change}}}]]
Monster/Spell/Trap categories
[[{{{m/s/t}}}|{{{m/s/t}}}]]
Summoning categories
[[{{{summoning}}}|{{{summoning}}}]]
Attack categories
[[{{{attack}}}|{{{attack}}}]]
Banished categories
[[{{{banished}}}|{{{banished}}}]]
Life Points
[[{{{life_points}}}|{{{life_points}}}]]
Fusion Material for
[[{{{fm_for}}}|{{{fm_for}}}]]
Synchro Material for
[[{{{sm_for}}}|{{{sm_for}}}]]
Miscellaneous
[[{{{misc}}}|{{{misc}}}]]

Copy paste the following to add this to a template:

{{ #if: {{{supports|}}}{{{anti-supports|}}}{{{archseries|}}}{{{supports_archetypes|}}}{{{anti-supports_archetypes|}}}{{{related_to_archseries|}}}{{{counter|}}}{{{action|}}}{{{stat_change|}}}{{{m/s/t|}}}{{{summoning|}}}{{{attack|}}}{{{banished|}}}{{{life_points|}}}{{{fm_for|}}}{{{sm_for|}}}{{{misc<includeonly>|</includeonly>}}} | &#32;
==Search categories==
  {{Search categories
  | monster                  = <!-- parameters/checks to determine if the card is a monster, e.g. {{ #if: {{{atk|}}}{{{def|}}}{{ #var: $stars }} }} -->
  | monster_type             = <!-- check to see if the monster is a type that can't always be Special Summoned: Fusion, Ritual, Synchro, or Xyz -->
  | token                    = <!-- check to see if the monster is a token -->
  | supports                 = {{{supports<includeonly>|</includeonly>}}}
  | anti-supports            = {{{anti-supports<includeonly>|</includeonly>}}}
  | archseries               = {{{archseries<includeonly>|</includeonly>}}}
  | supports_archetypes      = {{{supports_archetypes<includeonly>|</includeonly>}}}
  | anti-supports_archetypes = {{{anti-supports_archetypes<includeonly>|</includeonly>}}}
  | related_to_archseries    = {{{related_to_archseries<includeonly>|</includeonly>}}}
  | counter                  = {{{counter<includeonly>|</includeonly>}}}
  | action                   = {{{action<includeonly>|</includeonly>}}}
  | stat_change              = {{{stat_change<includeonly>|</includeonly>}}}
  | m/s/t                    = {{{m/s/t<includeonly>|</includeonly>}}}
  | summoning                = {{{summoning<includeonly>|</includeonly>}}}
  | attack                   = {{{attack<includeonly>|</includeonly>}}}
  | banished                 = {{{banished<includeonly>|</includeonly>}}}
  | life_points              = {{{life_points<includeonly>|</includeonly>}}}
  | fm_for                   = {{{fm_for<includeonly>|</includeonly>}}}
  | sm_for                   = {{{sm_for<includeonly>|</includeonly>}}}
  | misc                     = {{{misc<includeonly>|</includeonly>}}}
  }}
}}