Template:Item infobox

From Terraria Wiki
Jump to: navigation, search

Этот шаблон определяет таблицу «Items». Просмотр таблицы.

This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for Templates to learn more.
See Template:Item infobox/l10n for the localization of this template.
Lua logo.svg
This template uses Module:Iteminfo, a script written in the Lua programming language. Please see wikipedia:Lua and mw:Extension:Scribunto to learn more about Lua.
Template-info.svg Documentation The documentation below is transcluded from Template:Item infobox/doc. (edit | history)

This template is used for displaying the infobox for an item. It is one of the most important and most powerful infobox templates.

Usage

While the template is extremely versatile, its main functionality is to display the standard infobox.

The data which is to be displayed can be manually entered when calling the template, but thanks to {{iteminfo}}, the vast majority of data is generated automatically. To enable automatic data, use the parameter auto and set it to the ID of the item (alternatively: auto=yes and either id=<item ID>, name=<item name>, or nothing else – the latter two methods will cause the template to automatically generate the ID using {{itemNameFromId}}, with the last method using the page title for name reference). This way, all relevant item parameters are set automatically. See the table below for affected parameters. However, they can still be overridden and manually entered parameters always take precedence over the automatic ones.

Basic parameters

Notes:
  • The dollar sign ($) is used to signify that the word after it is the name of a template parameter.
  • All parameters which have a default value listed can usually be omitted. Note that this does not mean that parameters which do not have a default value listed should always be filled in.
Parameter Description Auto Example Default value
(if omitted)
Note
{{item infobox
Box-related parameters
| boxwidth Width of the infobox 27em 21em Number with unit. Default is 21em or stretching to image width
| float Position of the infobox left right
| css
 or
| style
CSS style affecting the entire infobox Any width or float properties defined here will override the template's $boxwidth and $float parameters, respectively.
| auto Enables automatic data 465 Can also be yes (see text above).
| id ID of the item Yes 465 The automatic data gathering for $tooltip is based on this.
| name Name of the item Yes Wood Page name Will be displayed as heading of the infobox.
| lname Localized name of the item Yes Legno
(Italian for "Wood")
{{tr|$name}} Will be displayed as heading of the infobox; only to be used if $name is not existent in the {{tr}} database of the specific language.
| showenglishname Display of English name of this item yes
no
Defaults to no for languages that have an in-game translation (en, de (German), es (Spanish), fr (French), it (Italian), pl (Polish), pt (Portuguese), ru (Russian), zh (Chinese)), and to yes for all other languages.
| namesub Name sub-heading Additional information directly underneath the title of the infobox; rarely useful for item infoboxes.
Image-related parameters
| imagealt Complete custom control over the entire image display [[File:Wood.png]] Overrides all image parameters in this parameter category (except for $imagebreak).
| ext File extension of $image gif png
| image Main image of the inventory icon or equipped item/set Wood.png $name.$ext
| imageold Variant image of the older versions Compass (old).png $name (old) Default value: First checks for the .gif and then for the .png. Due to the way the automatic image detection is handled internally, it will likely fail on items whose name contains a dot (e.g. S.D.M.G.). It is necessary to explicitly specify the image in that case. (This applies to all image-related parameters.)
| imageplaced Image of the placed item Wood (placed).png $name (placed)
| imageequipped Image of the equipped item/set Shackle (equipped).png $name (equipped)
| imagefemale Image of the female equipped item/set Robe (equipped) female.png $name female.$ext
| imageoldalt Complete custom control over the "old" image display [[File:Compass (old).png]]
| imageplacedalt Complete custom control over the "placed" image display [[File:Wood (placed).png]]
| imageequippedalt Complete custom control over the "equipped" image display [[File:Shackle (equipped).png]]
| imagebreak Arranges multiple images in rows rather than in columns yes Causes the main/"old", "placed", "equipped", and "female" images to all take up a separate row, with small horizontal bars in between (example: Book). Note that the main and "old" images will always be displayed in the same row. Also note that this effect is enabled regardless of what $imagebreak is set to (i.e, setting it to no will also enable it – so refrain from doing that).
| imagemode Controls image selection placed/equipped full If set to full (which will only be the default for the infobox $view), the template will attempt to display all different types of images mentioned above. If not set to full, it will only attempt to display the main image (which will be the case for other $views by default, e.g. table), for performance reasons. It is possible, however, to enable (attempted) display of certain image types even if the mode is not full: Set the parameter to old, placed, equipped, or any combination of these three to cause the template to fetch these images as well.
| imageinfo Prevents the internal usage of {{image}} no Setting it to no will cause the template to use the standard [[File:]] syntax instead of {{image}}. {{image}} will increase the expensive function count, so if there are many item infoboxes on one page, the expensive function count limit may be exceeded. Using imageinfo=no can reduce the count to avoid exceeding it. In the vast majority of cases, this is not necessary.
Statistics-related parameters
| autoswing Auto-use capability Yes yes Displays Autoswing, Autofire, or Auto-use in the top-right corner of the infobox. Hover text is determined by $damagetype ("Autoswing" for melee, "Autofire" for ranged and magic, and "Auto-use" for anything else).
| stack Maximum possible stack size Yes[1] 99 1 Maximum quantity of this item that can be stacked in a single inventory slot.
| pick Pickaxe power Yes[1] 100 Without percentage sign (%), unless more complex wikitext is used. If any of the three parameters is used, all three symbols will always be displayed: Pickaxe icon.png Hammer icon.png Axe icon.png
| hammer Hammer power Yes[1] 75
| axe Axe power Yes[1] 50
| pickreq Required pickaxe power for destroying No 150 Without percentage sign (%)!
| hammerreq Required hammer power for destroying No 80 Without percentage sign (%)! Prints the following behind it: "(only in Hardmode)"
| type
 (deprecated:
| type2)
Classification and categorization Yes Weapon/Tool Broad classifications like "Weapon", "Tool", "Furniture", etc. Separate multiple values with a slash (/). Many types, such as "Crafting material", will be added automatically.
| bait Bait power Yes Without percentage sign (%)!
| damage Damage Yes[1]
| damagetype Damage type Yes[1] Possible values: melee, ranged, magic, summon, and throwing. The infobox will automatically categorize the page in the appropriate weapon type category, but only for the automatically generated damage type. For any additional, manually added damage type, a |listcat=<damage type> weapons will be necessary.
| knockback Knockback Yes[1] @@@@ / {{kb|5}} If more than one value is needed, wrap the individual values with {{kb}} in order to ensure correct styling. The @@@@ string does not need {{kb}}.
| defense Defense Yes[1]
| tileboost Tile range boost Yes
| bonus Miscellaneous bonuses No
| setbonus Set bonus Yes[1] For armor sets, where $type contains Set. Note that because this parameter is only sensible for set item infoboxes – which don't use $auto since it doesn't work with sets – its data will always be generated automatically (instead of only when $auto is set). Set this parameter to an empty value to hide the automatically generated set bonus.
| placeable Placeable Yes yes no
| width Width when placed No In tiles. Defaults to 1 for blocks.
| height Height when placed No
| consumable Consumable Yes True if the item leaves the player's inventory with Use / Attack; includes placeable items. It is found in the game's source code.
| mana Mana cost Yes[1]
| mheal Mana restoration Yes[1]
| hheal Health restoration Yes[1]
| critical Critical strike chance Yes[1] 11 Without percentage sign (%), unless more complex wikitext is used. If no value is entered and the main $type is Weapon, a default value of 4 will be used.
| body slot Body slot Yes
| use Use time Yes[1] @@@@ / {{ut|30}} If more than one value is needed, wrap the individual values with {{ut}} in order to ensure correct styling. The @@@@ string does not need {{ut}}.
| velocity
 (deprecated:
| sspeed)
Velocity Yes[1]
| toolspeed Tool speed Yes[1]
| tooltip Tooltip Yes[1]
| rare Rarity Yes[1] @@@@ / {{rare|0}} Use the {{rare}} template.
| research Research required Yes 5
| buy Buy value Yes[1] Enter the value using the coin template ({{coin}}). If using $auto, use buy=y/yes/true/show to enable display of automatic buy price (disabled by default, since many items that can be sold cannot be bought). Alternatively, add buy, buyable, or vendor to $tags.
| sell Sell value Yes[1] Also enter the value using the coin template.
| value Value Yes Mostly used internally. Will not be displayed directly, but serves as the base for $buy and $sell.
Buff- & Debuff-related parameters
| buff Buff provided Yes As a shortcut for $buffduration and $buffchance, append them to this value, separated with a slash: | buff = <name> / <duration> / <chance>. Chance may also be omitted.
| idbuff Buff ID Yes
| bufflink Buff link target Yes
| bufftip Buff tooltip Yes
| buffchance Buff chance Yes
| buffduration Buff duration Yes[1]
| buff<n> Additional buff provided No Can be continued nearly infinitely, e.g. buff2, buff3, etc.
| idbuff<n> Buff ID No
| bufflink<n> Buff link target No
| bufftip<n> Buff tooltip No
| buffchance<n> Buff chance No
| buffduration<n> Buff duration No
| debuff Debuff inflicted Yes As a shortcut for $debuffduration and $debuffchance, append them to this value, separated with a slash: | debuff = <name> / <duration> / <chance>. Chance may also be omitted.
| iddebuff Debuff ID Yes
| debufflink Debuff link target Yes
| debufftip Debuff tooltip Yes
| debuffchance Debuff chance Yes
| debuffduration Debuff duration Yes[1]
| debuff<n> Additional debuff provided No Can be continued nearly infinitely, e.g. debuff2, debuff3, etc.
| iddebuff<n> Debuff ID No
| debufflink<n> Debuff link target No
| debufftip<n> Debuff tooltip No
| debuffchance<n> Debuff chance No
| debuffduration<n> Debuff duration No
Sound-related parameters
| sounduse Use sound effect Yes Item_1.wav Can be a comma-separated list for multiple sounds. Caption is "Use".
| sound1 Custom additional sound effect Can be a comma-separated list for multiple sounds.
| soundcaption1 Caption for the sound effect
| sound2 Custom additional sound effect Can be a comma-separated list for multiple sounds.
| soundcaption2 Caption for the sound effect
| sound<n> Custom additional sound effect Can be continued nearly infinitely. Sounds will only be displayed if there is a sound<n> parameter with a corresponding soundcaption<n> parameter.
| soundcaption<n> Caption for the sound effect
Mount-related parameter
| idmount Mount ID Yes
Projectile-related parameters
| idprojectile
 (deprecated:
| shoot)
Projectile ID Yes Can be a comma-separated list for multiple IDs.
| projectilename Projectile name Yes
| projectileimage Projectile image Yes
| projectileblock Projectile images arrangement No Operates similarly to $imagebreak.
ID-related parameters
| showids Display of ID section No no ID section is not hidden by default.
| idshow Vanity item ID No
| idtile Tile ID Yes
| idtileshow Vanity tile ID No
| idtilesub Tile sub-ID Yes Internally known as placeStyle in Terraria.
| idwall Wall ID Yes
| idarmor Armor ID Yes
| idbuffshow Vanity buff ID No
| idbuffshow<n> Vanity buff ID No
| iddebuffshow Vanity debuff ID No
| iddebuffshow<n> Vanity debuff ID No
Back-end-related parameters
| cate Toggles categorization No no Set to yes to force categorization when it is disabled by default (on non-mainspace pages). Set to no to disable categorization.
| listexclude Toggles categorization No yes no Set to yes to disable categorization. Overrides cate=yes, but not cate=no.
| cargo Toggles cargo data storage No no Set to force to force cargo data storage when it is disabled by default (on non-mainspace pages). Set to no to disable cargo data storage. Note that setting it to anything else (e.g. yes) also disables cargo data storage, so please stick to the unambiguous no.
| listcat Categorization Yes Supplemental category names to include the current item in a DPL list, e.g. arrows causes the item to display at the Arrows page. Separate multiple categories with a slash character (/). The following categories will be added automatically:
| tag
 or
| tags
Categorization Yes Supplemental category names to appropriately categorize the item. Can contain any of the following (separate multiple with a slash character (/):
  • buy/buyable/vendor (implies buy=yes)
  • hardmodeonly/hardmode (implies hardmode=yes)
  • allversions (implies allversions=yes)
  • dd2 (means that this item is to be purchased with Defender Medal.)
  • drop (implies listcat=drop items)
  • loot (implies listcat=loot items)
  • plunder (implies listcat=plunder items)
  • fished (implies listcat=fished items)
  • unobtainable (implies listcat=unobtainable items)
  • developer (implies listcat=developer items).
  • storage (implies listcat=storage items).
  • informational (implies listcat=informational items).
  • quest rewards (implies listcat=quest rewards).
  • light source (implies listcat=light source items).
  • novelty (implies listcat=novelty items).
  • mechanism (implies listcat=mechanism items).
  • potion ingredients (implies listcat=potion ingredients).
  • bag loot/bagloot (implies listcat=bag loot items).
  • treasure bag loot (implies listcat=Treasure Bag loot items).
  • minion (implies type=weapon and listcat=minion summon items).
  • sentry (implies type=weapon and listcat=sentry summon items).

All other values will have no effect. All tags will be stored to cargo for querying.

| allversions Platform version availability Yes Set to yes to assert that the item is available on all platforms of Terraria. This is only to be used if no {{exclusive}} banner is on the page. If omitted and if $tags does not contain allversions, it will be detected automatically based on the result of {{eversions|<item name>}} (even though $auto might not be set!). Categorizes the page in all five version content categories (with the exception of Category:Japanese console content), if yes is determined.
| hardmode Hardmode-exclusivity Yes yes Set to yes to assert that the item is not available in pre-Hardmode, but only becomes available in Hardmode. Categorizes the page in Category:Hardmode-only items.

View-related parameters

By default, an item infobox is displayed in the standard infobox style, a boxed, table-like listing of stats on the right of the article text. It is possible to change the display format (called "view"), however – there are four other views available: custom, item, table, and void (additionally test). They can be selected via the $view (aliases: $mode, $output) parameter. Each view has an own subpage which contains the code for the respective output.

View Description Subpage
custom Completely custom output. Requires a $template parameter with the name of the template that contains the custom code for the output. (For instance, |view=custom|template=item infobox/infoboxView could also be used for a standard infobox style, because {{item infobox/infoboxView}} contains the code for the infobox output.) /customView
infobox
(default)
Standard infobox-style output. /infoboxView
item Displays the item as formatted by {{item}}. /itemView
table Displays an entire table row (including the row separator, |-). Requires a $cols parameter that defines which columns are to be displayed. /tableView
void Does not display anything. This is useful when it is necessary to store item information to the Cargo database, but an own infobox for the item is unwanted (e.g. on group pages, where there is a main infobox for all items of the group). /voidView

Subpages

There are numerous supplemental subpages which are mainly used for formatting certain data:

See also

Footnotes

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 Any occurrence of the string @@@@ in the parameter value will be replaced by the automatically generated data. This can be used to mix automatic and manual data.