Difference between revisions of "Template:Deck List Row"

From mtgpq wiki
Jump to: navigation, search
 
(32 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 +
==Usage==
 
A row in [[Template:Deck_List]].
 
A row in [[Template:Deck_List]].
  
== Parameters ==
+
The first parameter is the card name.
# A card name
+
* A missing card name causes the template to produce no output.
# The card type (creature, spell, or support)
+
* A question mark for the card name is formatted as an unknown card.
  
== Example ==
+
The second parameter is an optional comma-separated list of fields to display.
This code:
+
 
 +
The possible fields are:
 +
* type - The type of the card, along with P/T for creatures and shields for supports
 +
* cost - The cost in mana of the card
 +
* color - The color of the card
 +
* rarity - The rarity of the card
 +
* set - The set containing the card
 +
* legacy - A legacy banner if the card is from a legacy set
 +
 
 +
Each field is in its own column except for Legacy, which is in the same column as Set.
 +
 
 +
Fields are always displayed in the order above.  The default fields used if none are specified are all of the above.
 +
 
 +
 
 +
==Example==
 +
 
 +
The following shorthand:
 
<pre><nowiki>
 
<pre><nowiki>
{{Deck List Row|Champion of Wits|creature}}
+
{| class="wikitable"
 +
!Card name || Type || Cost || Color || Rarity || Set<!--
 +
-->{{Deck List Row|Zetalpa, Primal Dawn}}<!--
 +
-->{{Deck List Row|Crush of Tentacles}}<!--
 +
-->{{Deck List Row|Time of Ice}}<!--
 +
-->{{Deck List Row|Storm the Vault}}<!--
 +
-->{{Deck List Row|Storm the Vault//Vault of Catlacan}}<!--
 +
-->{{Deck List Row|Beanstalk Giant//Fertile Footsteps}}
 +
|}
 +
 
 +
{| class="wikitable"
 +
!Card name || Type<!--
 +
-->{{Deck List Row|Zetalpa, Primal Dawn|type}}<!--
 +
-->{{Deck List Row|?}}<!--
 +
-->{{Deck List Row|Black Lotus}}
 +
|}
 
</nowiki></pre>
 
</nowiki></pre>
  
Produces this content:
+
Produces:
  
{{Deck List Row|Fateful Showdown|creature}}
+
{| class="wikitable"
 +
!Card name || Type || Cost || Color || Rarity || Set<!--
 +
-->{{Deck List Row|Zetalpa, Primal Dawn}}<!--
 +
-->{{Deck List Row|Crush of Tentacles}}<!--
 +
-->{{Deck List Row|Time of Ice}}<!--
 +
-->{{Deck List Row|Storm the Vault}}<!--
 +
-->{{Deck List Row|Storm the Vault//Vault of Catlacan}}<!--
 +
-->{{Deck List Row|Beanstalk Giant//Fertile Footsteps}}
 +
|}
  
</noinclude><includeonly>|-
+
{| class="wikitable"
 +
!Card name || Type<!--
 +
-->{{Deck List Row|Zetalpa, Primal Dawn|type}}<!--
 +
-->{{Deck List Row|?}}<!--
 +
-->{{Deck List Row|Black Lotus}}
 +
|}
  
|{{#ifeq:{{lc:{{{2}}}}}|creature|[[File:Creature-Icon.png|{{{size|x16px}}}]]|<!--
+
</noinclude><includeonly>{{#ifeq:{{#sub:{{Card data: {{{1}}}}}|0|1}}|{|&nbsp;
-->{{#ifeq:{{lc:{{{2}}}}}|spell|[[File:Spell-Icon.png|{{{size|x16px}}}]]|<!--
+
{{!}}-
-->{{#ifeq:{{lc:{{{2}}}}}|support|[[File:Support-Icon.png|{{{size|x16px}}}]]}}}}}}<!--
+
{{!}} {{Card URL|{{Trim|{{{1}}}}}}}            <!--Name-->
--> &nbsp;[[{{{1}}}]]</includeonly>
+
{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|type}}|1|0}}}}|1|<!--
 +
-->{{!}} {{{{#explode:{{Card data: {{{1}}}|6}}|,|0}}s}}<!--              Type
 +
-->{{#if:{{#pos:{{Card data: {{{1}}}|6}}|,}}|//{{{{#explode:{{Card data: {{{1}}}|6}}|,|1}}s}}}}<!--
 +
-->{{#if:{{#pos:{{Card data: {{{1}}}|6}}|Creature}}| &nbsp;({{Card data: {{{1}}}|8}})|<!--
 +
-->{{#if:{{#pos:{{Card data: {{{1}}}|6}}|Support}}| &nbsp;({{Card data: {{{1}}}|9}})}}}} }}
 +
{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|cost}}|1|0}}}}|1|<!--
 +
-->{{!}} {{#replace:{{Card data: {{{1}}}|5}}|,|//}} }}                <!--Cost-->
 +
{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|color}}|1|0}}}}|1|<!--
 +
-->{{!}} {{Color Icons|{{Card data: {{{1}}}|4}}|16}}}} <!--Color-->
 +
{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|rarity}}|1|0}}}}|1|<!--
 +
-->{{!}} {{Rarity|{{Card data: {{{1}}}|3}}}} }}      <!--Rarity-->
 +
{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|set}}|1|0}} or {{#if:{{#pos:{{{2|}}}|legacy}}|1|0}}}}|1|<!--
 +
-->{{!}} {{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|set}}|1|0}}}}|1|<!--
 +
-->{{SetSymbol|{{Card data: {{{1}}}|2}}}} [[{{Card data: {{{1}}}|2}}]] }}<!--
 +
-->{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|legacy}}|1|0}}}}|1|<!--
 +
-->{{#if:{{#pos:{{StandardSetList}}|{{Card data: {{{1}}}|2}}}}||&nbsp;{{Legacy icon|17}}}} }}<!-- Set
 +
-->}}|<br>
 +
{{!}}-
 +
{{!}} {{{1|}}}
 +
{{!}} colspan="5" {{!}} ''{{#ifeq:{{{1}}}|?|Unknown card|Missing card data}}''}}</includeonly>

Latest revision as of 11:36, 28 April 2020

Usage

A row in Template:Deck_List.

The first parameter is the card name.

  • A missing card name causes the template to produce no output.
  • A question mark for the card name is formatted as an unknown card.

The second parameter is an optional comma-separated list of fields to display.

The possible fields are:

  • type - The type of the card, along with P/T for creatures and shields for supports
  • cost - The cost in mana of the card
  • color - The color of the card
  • rarity - The rarity of the card
  • set - The set containing the card
  • legacy - A legacy banner if the card is from a legacy set

Each field is in its own column except for Legacy, which is in the same column as Set.

Fields are always displayed in the order above. The default fields used if none are specified are all of the above.


Example

The following shorthand:

{| class="wikitable"
!Card name || Type || Cost || Color || Rarity || Set<!--
-->{{Deck List Row|Zetalpa, Primal Dawn}}<!--
-->{{Deck List Row|Crush of Tentacles}}<!--
-->{{Deck List Row|Time of Ice}}<!--
-->{{Deck List Row|Storm the Vault}}<!--
-->{{Deck List Row|Storm the Vault//Vault of Catlacan}}<!--
-->{{Deck List Row|Beanstalk Giant//Fertile Footsteps}}
|}

{| class="wikitable"
!Card name || Type<!--
-->{{Deck List Row|Zetalpa, Primal Dawn|type}}<!--
-->{{Deck List Row|?}}<!--
-->{{Deck List Row|Black Lotus}}
|}

Produces:

Card name Type Cost Color Rarity Set 
Zetalpa, Primal Dawn Creatures (4/8) 19 White Mythic Rivals of Ixalan RIX Legacy 
Crush of Tentacles Spells 21 Blue Mythic Oath of the Gatewatch OGW Legacy 
Time of Ice Supports (2) 18 Blue Uncommon Dominaria DOM Legacy 
Storm the Vault Supports (4) 11 BlueRed Rare Rivals of Ixalan RIX Legacy 
Storm the Vault//Vault of Catlacan Supports (4) 11 BlueRed Rare Rivals of Ixalan RIX Legacy 
Beanstalk Giant//Fertile Footsteps Creatures//Spells (1/1) 12//11 Green Mythic Throne of Eldraine ELD Legacy
Card name Type 
Zetalpa, Primal Dawn Creatures (4/8)
? Unknown card
Black Lotus Missing card data