Hearthstone Wiki
No edit summary
No edit summary
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<onlyinclude><includeonly>{{#if:{{{where|}}}|{{{where}}}|{{#lstsep:<!--
 
<onlyinclude><includeonly>{{#if:{{{where|}}}|{{{where}}}|{{#lstsep:<!--
 
-->{{#tokenif:{{#replace:{{#if:{{{categoryname|}}}{{{category|}}}|{{{categoryname|}}},{{#lstmap:{{{category|}}}|,|@@@@|@@@@_card_data|,}}|Card_data}}{{#switch:{{lc:{{{format|}}} }}|standard=,Standard_format_cards|wild-only=,Wild_format_cards}}| |_}}|@@@@|<esc>{{Holds all of|category|@@@@}}</esc> }}~<!--
 
-->{{#tokenif:{{#replace:{{#if:{{{categoryname|}}}{{{category|}}}|{{{categoryname|}}},{{#lstmap:{{{category|}}}|,|@@@@|@@@@_card_data|,}}|Card_data}}{{#switch:{{lc:{{{format|}}} }}|standard=,Standard_format_cards|wild-only=,Wild_format_cards}}| |_}}|@@@@|<esc>{{Holds all of|category|@@@@}}</esc> }}~<!--
  +
-->{{#switch:{{lc:{{{bg_type|}}} }}|all=|either=Cards.bg_type IS NOT NULL|none=Cards.bg_type IS NULL|regular=Cards.bg_type="Regular"|gold=Cards.bg_type="Gold"|Cards.bg_type IS NULL}}~<!--
 
-->{{#if:{{{name|}}}|({{#lstmap:{{{name|}}}|\!\!|@@@@|Cards.name=CONCAT(<esc>{{#lstmap:@@@@|\_|$$$$|<esc1>{{#lstmap:$$$$||%|"%"|,}}</esc1>|," ",}}</esc>)|\_OR\_}})|}}~<!--
 
-->{{#if:{{{name|}}}|({{#lstmap:{{{name|}}}|\!\!|@@@@|Cards.name=CONCAT(<esc>{{#lstmap:@@@@|\_|$$$$|<esc1>{{#lstmap:$$$$||%|"%"|,}}</esc1>|," ",}}</esc>)|\_OR\_}})|}}~<!--
  +
-->{{#if:{{{tier|}}}|({{#if:{{#pos:{{{tier}}}|~}}|Cards.tier>="{{#explode:{{{tier}}|~|0}}" AND Cards.tier<="{{#explode:{{{tier}}}|~|1}}"|Cards.tier="{{{tier}}}"}})|}}~<!--
 
-->{{#if:{{{type|}}}|({{#lstmap:{{{type|}}}|\!\!|@@@@|Cards.type=CONCAT(<esc>{{#lstmap:@@@@|\_|$$$$|<esc1>{{#lstmap:$$$$||%|"%"|,}}</esc1>|," ",}}</esc>)|\_OR\_}})|}}~<!--
 
-->{{#if:{{{type|}}}|({{#lstmap:{{{type|}}}|\!\!|@@@@|Cards.type=CONCAT(<esc>{{#lstmap:@@@@|\_|$$$$|<esc1>{{#lstmap:$$$$||%|"%"|,}}</esc1>|," ",}}</esc>)|\_OR\_}})|}}~<!--
 
-->{{#if:{{{subtype|}}}|({{#lstmap:{{{subtype|}}}|\!\!|@@@@|Cards.subtype=CONCAT(<esc>{{#lstmap:@@@@|\_|$$$$|<esc1>{{#lstmap:$$$$||%|"%"|,}}</esc1>|," ",}}</esc>)|\_OR\_}})|}}~<!--
 
-->{{#if:{{{subtype|}}}|({{#lstmap:{{{subtype|}}}|\!\!|@@@@|Cards.subtype=CONCAT(<esc>{{#lstmap:@@@@|\_|$$$$|<esc1>{{#lstmap:$$$$||%|"%"|,}}</esc1>|," ",}}</esc>)|\_OR\_}})|}}~<!--

Revision as of 11:35, 8 December 2019

This template is used by other templates such as {{Cards}} and {{Custom card table}}, among others, that accept some or all of the same parameters as this template, and which need to build a valid where clause for a #cargo_query call from those they accept.

Because of numerous workarounds needed at the time of this writing, the where clause built is pretty ugly, which is one of the reasons this template exists.

This is intended primarily for use in query templates and probably has little value in direct use on articles.

Note: All parameters below are optional. If left blank, they will not affect what cards are shown.

{{Custom card table
  |categoryname=the exact name of a category to get cards from, not including the Category prefix. Multiple names can be provided separated by commas, and cards are returned only if they are in all the given categories.
  |category=name prefix of category to get cards from, should match that used for the category parameter on Card infobox. Multiple names can be provided separated by commas, and cards are returned only if they are in all the given categories.
  |bg_type="any" to get Battlegrounds and non-Battlegrounds cards, "either" to get Battlegrounds cards only, "regular" to get only non-gold Battlegrounds cards, "gold" to get only gold Battlegrounds cards, and "none" to get only non-Battlegrounds cards ("none" is default)
  |name=name of card(s) to show
  |tier=card tier, only relevant to Battlegrounds cards (a range can be specified using a minimum and maximum separated by ~)
  |type=type of cards to show
  |subtype=subtype of cards to show
  |class=class of cards to show, using "Any" for neutral cards
  |multiclass=multiclass of cards to show
  |rarity=rarity of cards to show
  |mana=mana cost of cards to show (a range can be specified using a minimum and maximum separated by ~)
  |attack=attack value of cards to show (a range can be specified using a minimum and maximum separated by ~)
  |health=health value of cards to show (a range can be specified using a minimum and maximum separated by ~)
  |gold=True to show only cards with a gold version, False to show only cards that do not
  |ability=show cards with this ability 
  |artist=show cards with this artist
  |voiceactor=show cards with this voice actor
  |tag=show cards with this tag
  |hiddentag=show cards with this hiddentag
  |collectible=True to show only collectible cards, False to show only uncollectible cards
  |set=page name of a set of cards to show
  |where=Overrides all other selection parameters above with an explicitly written Cargo query "where" clause.
}}