Template:MercHeader

From Dirty Bomb Wiki
Jump to: navigation, search
Template-info.png Documentation

This template performs a number of functions:

  • It draws information about a unit from a data page if it finds one for the merc. It can also draw information directly from its parameters like a typical template.
  • It displays the top portion of a merc page using that information by calling {{MercHeader/layout}}. Note that the visual and layout code is in that template with the exception of the multiple data page warning.
  • It sets properties and categories, which can be used to create automated lists.

Finding the data page[edit source]

The template finds a data page for an item in one of four ways:

{{MercHeader}}

When the nickname, datapage, and testdatapage parameters are not given values, the template looks for a data page in Category:Imported merc data where Property:Has name is the same as the name of the page the template is being used on.

{{MercHeader
  |nickname=merc nickname
}}

When the nickname parameter is given a value but datapage is not, the template looks for a data page in Category:Imported merc data where Property:Has name has that value.

{{MercHeader
  |datapage=data subpage name
}}

When datapage is given a value, the template looks for that page, but will return it only if the page is in Category:Imported merc data. When using this, specify only the subpage name of the data page. For example, for "Data:Mercs/EXAMPLE", just specify "EXAMPLE".

Note that an item data page should be set up with {{MercData}}, and the nickname parameter on that template sets the value of Property:Has name. If the nickname parameter doesn't get a value, Property:Has name is set to the subpage name.

{{MercHeader
  |testdatapage=full data page name
}}

testdatapage works the same as datapage except that it requires the full name of the data page, including the namespace. This is useful for testing data pages set up in a user namespace.

Other values[edit source]

Some information is not available from the imported data and must be supplied to the template separately, as shown below:

{{MercHeader
  |quote=merc's quote
  |profile=merc's profile
  |plant=time to plant explosives
  |defuse=time to defuse explosives
  |health_rating=1 to 5
  |speed_rating=1 to 5
  |combat_rating=1 to 5
  |objective_rating=1 to 5
  |support_rating=1 to 5
  |ingame=yes or no
  |available=yes or no
}}

Setting ingame to no flags that a unit is not available in the game, even though it is in the game data. Setting available to no indicates that the unit is not available to players even if it is in the game, such as something only available to gamemasters or other staff.

This can be used with any of the other parameters.

When there is no data page[edit source]

If an merc doesn't have a data page for some reason, you can treat this as a normal template and supply the values yourself.

{{MercHeader
  |nickname=The nickname of the merc
  |class_name=The merc's class name
  |class_desc=The merc's class description
  |health=the merc's health
  |speed=the merc's speed
  |portrait=Filename of the portrait image, without the "File:" namespace prefix
}}

Note that if a data page for the merc is imported later, the values of these parameters will be ignored.

Overriding data page values[edit source]

If necessary, it is possible to override the values pulled from the data page. When data is simply outdated, it's probably better to just change it on the data page itself, as it would probably have been corrected in the next data import anyway. But if for some reason imports seem to be consistently bringing in incorrect data, you can override it by using the force parameters:

{{MercHeader
  |force_nickname=The nickname of the merc
  |force_class_name=The merc's class name
  |force_class_desc=The merc's class description
  |force_health=the merc's health
  |force_speed=the merc's speed
  |force_portrait=Filename of the portrait image, without the "File:" namespace prefix
}}

This template defines the table "Mercs". View table.