Difference between revisions of "Template:Deck List Row"

From mtgpq wiki
Jump to: navigation, search
Line 35: Line 35:
 
{| class="wikitable"
 
{| class="wikitable"
 
!Card name || Type<!--
 
!Card name || Type<!--
-->{{Deck List Row|Zetalpa, Primal Dawn|type}}
+
-->{{Deck List Row|Zetalpa, Primal Dawn|type}}<!--
 +
-->{{Deck List Row|unknown_card}}
 
|}
 
|}
 
</nowiki></pre>
 
</nowiki></pre>
Line 52: Line 53:
 
{| class="wikitable"
 
{| class="wikitable"
 
!Card name || Type<!--
 
!Card name || Type<!--
-->{{Deck List Row|Zetalpa, Primal Dawn|type}}
+
-->{{Deck List Row|Zetalpa, Primal Dawn|type}}<!--
 +
-->{{Deck List Row|unknown_card}}
 
|}
 
|}
  
</noinclude><includeonly>{{#if:{{{1|}}}|&nbsp;
+
</noinclude><includeonly>{{#ifexpr:{{#if:{{{1|}}}|1|0}} and {{#ifexist: Template:Card data: {{{1}}}|1|0}}|&nbsp;
 
{{!}}-
 
{{!}}-
 
{{!}} {{Card URL|{{Trim|{{{1}}}}}}}            <!--Name-->
 
{{!}} {{Card URL|{{Trim|{{{1}}}}}}}            <!--Name-->
 
{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|type}}|1|0}}}}|1|<!--
 
{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|type}}|1|0}}}}|1|<!--
-->{{#ifexist: Template:Card data: {{{1}}}|<!--
 
 
-->{{!}} {{{{Card data: {{{1}}}|6}}s}}<!--        Type  with (P/T) or (shields)
 
-->{{!}} {{{{Card data: {{{1}}}|6}}s}}<!--        Type  with (P/T) or (shields)
 
-->{{#ifeq:{{Card data: {{{1}}}|6}}|Creature| &nbsp;({{Card data: {{{1}}}|8}})|<!--
 
-->{{#ifeq:{{Card data: {{{1}}}|6}}|Creature| &nbsp;({{Card data: {{{1}}}|8}})|<!--
Line 73: Line 74:
 
-->{{SetSymbol|{{Card data: {{{1}}}|2}}}} [[{{Card data: {{{1}}}|2}}]] }}<!--
 
-->{{SetSymbol|{{Card data: {{{1}}}|2}}}} [[{{Card data: {{{1}}}|2}}]] }}<!--
 
-->{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|legacy}}|1|0}}}}|1|<!--
 
-->{{#ifeq:{{#expr: {{#if:{{{2|}}}|0|1}} or {{#if:{{#pos:{{{2|}}}|legacy}}|1|0}}}}|1|<!--
-->{{#if:{{#pos:{{StandardSetList}}|{{Card data: {{{1}}}|2}}}}||&nbsp;[[File:Legacy-bg.png|x18px|link=Legacy|Legacy]]}} }} }}<!--           Set
+
-->{{#if:{{#pos:{{StandardSetList}}|{{Card data: {{{1}}}|2}}}}||&nbsp;[[File:Legacy-bg.png|x18px|link=Legacy|Legacy]]}} }}<!-- Set
-->|{{!}} colspan="5" {{!}} ''Missing card data''}}}}</includeonly>
+
-->}}|<br>
 +
{{!}}-
 +
{{!}} {{{1|}}} {{!}}{{!}} colspan="5" {{!}} ''Missing card data''}}</includeonly>

Revision as of 03:40, 16 March 2019

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.

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}}
|}

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

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
Card name Type 
Zetalpa, Primal Dawn Creatures (4/8)
unknown_card Missing card data