Template:Card

From Hearthstone Wiki
Jump to: navigation, search


This template can be used to create a 200px representation of a card, which when clicked on will link to the card's individual page.

Identifying the card to get the image for[edit source]

There are four ways to identify which card image to get.

By the content page (shortcut syntax)[edit source]

The first option is just to specify the card's content page name, followed by |gold if you want the gold image.

{{Card|page}}

or

{{Card|page|gold}}

You can also write it out the long way. With this, you need |gold=yes to get the gold image.

{{Card|page=page}}

or

{{Card|page=page|gold=yes}}

Optionally, exactpage can be used to prevent the template from following a redirect. It'll only return a result if there is a card content page with that exact name. With this, you need |gold=yes to get the gold image.

{{Card|exactpage=page}}

or

{{Card|exactpage=page|gold=yes}}


By the name[edit source]

The second option is just to specify the card name, followed by |gold=yes if you want the gold image.

{{Card|name=name}}

or

{{Card|name=name|gold=yes}}

If there is more than one card with this name, though, this will display multiple card images. In these cases, you'll need to use one of the methods below.

By data page name[edit source]

The third option is to explicitly specify which data page you want the card data pulled from. This works as follows:

{{Card|datapage=data page name}}

or

{{Card|datapage=data page name|gold=yes}}

Note that you should only include the subpage name. For example, do use Barrel(376), not Data:Cards/Barrel(376).

If you need to use a data page outside Data:Cards/ for any reason, use testdatapage instead of datapage and specify the full page name.

This guarantees no more than one image showing up, but if the data page doesn't exist, if it isn't using {{Card data}}, or there are certain problems with the data, nothing will show up.

By the specified fields[edit source]

The fourth option is to explicitly specify a card name, and optionally, other fields. This works as follows:

{{Card
  |name=name of card (uses the page name if not supplied)
  |type=
  |subtype=
  |class=
  |rarity=
  |mana=
  |attack=
  |health=
  |gold=yes if you want the gold image, no if you don't
}}

This option will pull data for any cards having the specified name and other fields.

When an image can't be located[edit source]

If a data page is located for a particular card, but the name for the requested isn't available, a simple link to the card's content page is displayed instead.

Example[edit source]

{{Card|Arcane Intellect}}


produces:

Arcane Intellect(489).png


{{Card|Arcane Intellect|gold}}


produces:

Arcane Intellect(489) Gold.png


{{Card|datapage=Barrel(376)}}


produces:

Barrel(376).png


{{Card|testdatapage=Data:Cards/Barrel(376)}}


produces:

Barrel(376).png