User:SBEyes/Card infobox/doc

From Hearthstone Wiki
Jump to navigation Jump to search

This template can be used in two ways:

  1. Most commonly, it will be used to pull imported data from a data page onto a card's regular content page.
  2. It can also be used to directly enter data for a card.
    • Since this has the side effects of adding the card information to lists, it should only be done for actual cards in the game.
    • Note that automated imports of card data will usually add data pages for new cards; they typically will not need to be added manually.

This template can also be used to add additional information to cards beyond that supplied by the automated imports. Note that the actual visual function of the infobox is handled by {{Card infobox/layout}}, which has no side effects beyond simply displaying the infobox.

Adding additional information[edit | edit source]

There is some information of interest about various cards that the importer cannot automatically acquire. These parameters allow you to add this useful information whether or not data is being pulled from a data page.

Not currently in play[edit | edit source]

If the card is not currently in play, use the |current= parameter as follows:

{{Card infobox
  |current=false
}}

The default is true.

Developer card[edit | edit source]

If the card is not available for play because it has a special purpose, such as being for gamemasters only or is used in the game outside of gameplay, use the |devonly= parameter as follows:

{{Card infobox
  |devonly=true
}}

The default is false.

Choose One effect[edit | edit source]

If the card is one of the possible effects of a Choose One card, use the |chosenfrom= parameter and supply the page name for the appropriate Choose One card as follows:

{{Card infobox
  |chosenfrom=page name
}}

Use the regular page name for the card, not its data page name.

Additional abilities[edit | edit source]

If the card has additional abilities that the automated importer did not include, the |addabilities= parameter can be used to add these abilities to the card data.

{{Card infobox
  |addabilities=Destroy, Immune
}}

Pulling card data from a data page[edit | edit source]

Data pages are set up by an automated importer which is run on the wiki from time to time. This information uses card information extracted from the game client. There are four ways to identify what data page the infobox should pull card data for.

Automatic, default method[edit | edit source]

The infobox automatically looks for a data page for a card with the same name as the page name the infobox is used on. This can acquire the wrong data if there are more than one card with that name. In these cases, a different method will need to be used.

By card name[edit | edit source]

Another name can also be specified using the |name= parameter.

{{Card infobox
  |name=name
}}

This can be useful if the page name and card name need to be different for some reason, but this has the same drawback as the automatic method; if there is more than one card with that name, it may not acquire the correct data.

By data subpage name[edit | edit source]

The third option is to explicitly specify which data page the card data should be acquired from by the subpage name of the data page. This works as follows:

{{Card infobox|datapage=data subpage name}}

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

This guarantees no more than one infobox 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 full data page name[edit | edit source]

All proper data pages should have names starting with Data:Cards/, but this isn't desirable for data pages used for testing. In this case, you can use the |testdatapage= parameter with a full page name to exactly specify which page to use.

{{Card infobox|testdatapage=data page name}}

Manual data entry[edit | edit source]

This can be used like a normal infobox as well, but be aware that it automatically adds card data to properties as well as performing automatic categorization. It is not intended for user-created cards or any cards not actually in the game. For anything like this, use {{Card infobox/layout}} directly, as it does not perform any of these functions.

Usage:

{{Card infobox
  |link=Hearthpwn URL without the http://www.hearthpwn.com part
  |image=image filename for the regular card without the File: prefix
  |has_gold=true if there is a gold version, false otherwise
  |gold_image=image filename for the gold card without the File: prefix
  |set=names of any sets this card is a part of, separated by commas
  |type=the type of the card, such as Equipment, Spell, or Minion
  |subtype=the subtype of the card, typically for minions
  |class=the class of the card
  |rarity=the rarity of the card
  |cost=the mana cost of the card, defaults to 0 if not provided
  |attack=the attack value of the card
  |hp=the health of the card
  |abilities=the abilities of the card, separated by commas
  |desc=the card's text description
  |flavor=the card's flavor text
}}

Important note: If this template finds a matching data page, any values supplied by the data page take priority over these manually entered values. In most cases when this happens, the manual values here should be removed to reduce potential confusion.

But if the data page values are incorrect:

  • The first step is simply to edit the data page itself and correct the inaccurate information there. It is probably just outdated and would be fixed by the next import anyway.
  • If imports are consistently setting up an incorrect value for a card, you can use the force parameters to override the data page value. For example, |force_cost=3 would make the mana cost 3 in all of the card data's regardless of the what the data page says. This is only appropriate as a last resort, however.