Template:Item/doc

An all-in-one template for display item name/icon/link.

By default, displays a link to the item and adds an item icon in front of it.

Usage
All parameters are optional. Despite this, some combinations are invalid and may cause errors, e.g.

See examples below for more details.

Default item display name, link target, and image file name. Also support # and ## syntax (see examples below).
 * unnamed parameter 1

Custom link text, which can include line breaks (&lt;br />) and other wikitext. If an 's', 'es', 'ies' or 'ves' is passed as the custom text, it will be appended to the end of the item name. Pluralism is partially intuitive - adding 's' to Butterfly will return Butterflies.
 * unnamed Parameter 2

Custom link text, it will override unnamed Parameter 2, and it will be displayed as-is, without plural processing.
 * t

Display mode. It can be: Use preferred values as much as possible to get the best performance.
 * mode
 *  (Preferred) or   or   means only image will be displayed;
 *  (Preferred) or   means no image will be displayed;
 *  (Preferred) or   will output 2 cells code for table. This is roughly a shortcut for

image filename, no brackets nor "File:"(must include file extension, eg. Parrot.png).
 * image

You can specify multiple images, just seperate filenames with slashes(eg. Parrot.png/Parrot (placed).png).

Custom graphic size (Read Extended image syntax for details).
 * size

You can specify multiple sizes, just seperated with slashes(eg. 32px/24x24px).

When multiple images specified:
 * If only one size specified, it will apply to all images
 * if size is less then image, extra images will be displayed as if they don't have size argument
 * if size is more then image, extra sizes will simply be ignored.

And you can append it with  to scale image, e.g. ,   ...

Image(s) will be scaled based on  and. e.g.  is equal to. This will multiply with scale factor in size paramter,  is equal to. scale can be set by options.
 * scale

Image size limit. Using standard image size syntax, eg. 32px/24x24px. will be applied after scale.
 * maxsize

image file extension, default is png. Only valid when there is no image input.
 * ext

Custom link target. If blank given(i.e.  ), it will be no link(See example below).
 * link

Same as  , only valid when there is no   input. If you use  , it will be ignored.
 * nolink = y/yes

If set, will create an anchor for  .
 * anchor = y/yes

Extra note text. By default, it will displayed as smaller and gray text next to the item name, and without link on it.
 * note

Another note text. By default, it will displayed as gray txt in normal size, without link, and always take a single line.
 * note2

Only valid when there is no id= or note2= input. If set, the note will be displayed in a new line.
 * wrap = y/yes

Number, will display items(or other type) ID infomation.
 * id

the type of ID, case-insensitive, default is  , only valid when id is sepcified. can be  ,  ,  ,  ,  ,  ,  , or  . All other values are treated as  .
 * type

Explicitly turn on/off id display. Default is on when  is set, off when   is not set.
 * showid = y/yes/n/no

Custom Css class(es). There're some predefined classes for certain formatting purpose(see examples below). You can add yours if needed.
 * class

Custom css style rules.
 * css or style

"#", "##", and "@" syntax
You can place "#" or "##" before main item name to auto append mod name, example:

And you can use  or "@" in item name to specify mod name:

Size and scale
Note: Due to the way of 's size option works, if you want to set a size(after scale) larger then origin image size, you need to set it in DDpx or DDxDDpx, and xDDpx will be no effect. e.g. for Beeswax,  will be no effect.

Wrap, id and note2
is valid only when  and   are not specified.

Display mode
{| class="terraria lined" ! Result !! Code !! Note
 * ||  || By default, it will display image and text info.
 * ||  || Force to use default mode.
 * ||  ||  : Only image will be displayed, no text, no note, no id.
 * ||  ||  : image won't be displayed.
 * ||  ||  : Only image will be displayed, no text, no note, no id.
 * ||  ||  : image won't be displayed.
 * ||  ||  : image won't be displayed.
 * ||  ||  : image won't be displayed.


 * : output as two adjacent cells for table.


 * : rowspan


 * : hide border between 2 cells.
 * }

Transform
You can transform item image via these CSS classes.

The transformation happens at the center of the image and its effective dimensions will retain the original values of the object as if untransformed. So be careful with  and.

Change default options
You can use item/options to set/get and reset some options' default value.

Usage

 * Set:   or  
 * get:  
 * reset:   or  

'''NOTE: In order to avoid unwanted influences, it is very important to reset options as soon as possible. Especially in the template, you should reset options before the template ends.'''

All parameters:

Action.   or   means get the current value of a option,   or   means reset all options to default value, other values(include none. if you want, recommend to use   for better readability) means set options' value.
 * unnamed parameter 1

The name of option which you want to get its value, only valid when action is get. Can be  ,  ,  ,  ,   or  .
 * unnamed Parameter 2

Only valid when action is set. Set the default value for item's mode parameter. You can use any valid value for item's mode parameter, and a invalid value(recommend to use  ,  , or   for better readability) means change the mode back to default. See item's   parameter.
 * mode

Only valid when action is set. Turn on/off line wrap. See item's   parameter.
 * wrap = y/yes/n/no

Only valid when action is set. Turn on/off anchor. See item's   parameter.
 * anchor = y/yes/n/no

Only valid when action is set. Turn on/off no link option. See item's   parameter.
 * nolink = y/yes/n/no

Only valid when action is set. Default value for  . See item's   parameter.
 * class

Only valid when action is set. Default value for  . See item's   parameter.
 * css/style

See examples below for more details.