Template:Infobox Item

From the Tesseract Wiki, the wiki for all things Marvel Cinematic Universe
Jump to navigation Jump to search
Template documentation
This documentation is transcluded from Template:Infobox Item/doc. [edit] [history] [purge]
Template:Infobox Item invokes function main in Module:Infobox Item using Lua.

The standard infobox for an item.

Standard parameters

This template uses Module:Infobox, and as such the following standard parameters apply.

Versioning

This template supports versioning. To make a versioned infobox, simply add version# parameters, starting at 1 and increasing until all required versioned are covered. The value of the version parameter is the name given to the version, which applies to the button/option to select the version, as well as to any SMW subobjects used.

For example, |version1=used|version2=broken.

Other parameters can (and at least some should) be versioned, and can be done by appending corresponding integers to the parameter name (e.g. |name1=Thanos|name2=Thanos (2014)).

If a version name is set to a value that results in an invalid name for a subobject, the subobject name will be modified and Category:Pages with an invalid subobject name will be added to the page.

By default, multi-version infoboxes use 1-based indexes as the switch IDs. If multiple multi-version infoboxes or Template:Switch infoboxes exist on the same page, this can cause conflicts. If needed, you can manually specify switch IDs using the switch_id# parameter (e.g. |switch_id1=alt1|switch_id2=alt2). For more info, see Template:Switch infobox § Specifying switch IDs.

smwname

This sets the Semantic MediaWiki subobject(s) that the infobox (or current infobox version) should set the parameters into. This is only required when the infobox version name is not the intended destination of semantic properties, or if an unversioned infobox needs to set properties into a specific subobject (e.g. when versioned and unversioned infoboxes (of different types, like Item and Bonuses) are used on the same page).

By default if the page has versions, properties are set into named subobjects, where the names are the version names; if the page does not have versions, the properties are set on to the page itself. Setting smwname overrides the default behaviour - the properties will be set to the specified subobjects and only the specified subobjects.

Multiple subobjects can be specified by separating the subobject names with the broken bar ¦ - the properties will be set in all of the subobjects specified.

smwname can be versioned to change where specific infobox versions set the properties.

__dump__

If __dump__ is present with any value, rather than displaying the infobox as normal, a string version of the infobox object is dumped to the page. This is for debugging the infobox and should only be used by previewing the page; it should never be saved in a mainspace page. Setting this adds Category:Dumping infoboxes to the page.

Specifically, this applies when the infobox is converted to a string, which will always occur when the module finally returns, but may occur earlier in the code. The object is dumped using mw.dumpObject(box). Dumping will not prevent a script error occuring.

Parameters

name

The name of the item as it appears in universe, exactly.

image

An image of the item.

creator

The creator of the item.

Defining multiple items at once

Infobox Item supports the ability to display multiple items with a single template. Additional items will be stored quietly and displayed when prompted by user input. Proper display of the switchfobox version requires the reader to have JavaScript enabled.

Additional items are defined with the respective version# parameter. The value passed to this parameter will also define its label to the reader. The module will look for the highest version in an unbroken sequence; i.e. the module begins its search at version1 and will count up until version# does not exist.

When a version is defined, other parameters may be defined for it by using param#, where # is the number of the version. If undefined, param# will default to the value of the unqualified param.

Blank infobox

{{Infobox Item
|name = 
|image = 
|creator = 
}}

Complete infobox with comments

{{Infobox Item
|name = <!-- The in-universe name of the item -->
|image = <!-- [[File:ItemName.png]] -->
|creator = <!-- The creator of the item -->
}}

Template data

Show/hide template's data

The following information is used by extensions and applications, such as VisualEditor, to help users implement this template onto pages. Please ensure that it is up-to-date.

An infobox for items.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
namename

The name of the item as it appears in universe, exactly.

Auto value
{{subst:PAGENAME}}
Stringrequired
imageimage

An image of the item.

Filesuggested
creatorcreator

The creator of the item.

Example
[[Scott Lang]]
Datesuggested