Template:Image

From Terraria Mods Wiki
Jump to navigation Jump to search
This template uses the Cargo extension.
This template uses Extension:Cargo, an integral part of the wiki's back-end.
  • This template defines the table "Imageinfo". View table.
Template-info.svg Documentation The documentation below is transcluded from Template:Image/doc. (edit | history)

If the filename is passed without its extension, will determine if a gif is available (defaults to png); returns the image; if file exists as neither gif nor png, returns a null value.

If the filename includes an extension, will check if the file exists, returning null if it doesn't.

Also supports # syntax, i.e. {{image|#filename}}.

Usage

{{image|options|caption}}

Parameters

All [[File:]] syntax is valid.

In addition:

size =

Overrides the unnamed size option. Supports *scale syntax. Example: |20px|size=40px*0.75 will parse as 40px*0.75, results in 30px

scale =

Scales the image based on its size. e.g. scale=0.5.

maxsize =

Uses the same syntax as the [[File:]]'s size option: Wpx, Hpx, or WxHpx. Note: this is applied AFTER scale.

redlink =

For files that do not exist, this template outputs nothing by default. If this parameter is set, this template will output red link for the file.

Examples

Take Orchid Mod for example, use {{modname|set|Orchid Mod}} first.

code result expected expensive calls
{{image|Boom Shroom (Orchid Mod).png}} Boom Shroom (Orchid Mod).png (image) 0
{{image|Boom Shroom.png}} (blank) 0
{{image|Boom Shroom.png|redlink=y}} File:Boom Shroom.png (red link) 0
{{image|#Boom Shroom.png}} (recommended) Boom Shroom (Orchid Mod).png (image) 0
{{image|Boom Shroom}} (blank) 1
{{image|Boom Shroom (Orchid Mod)}} Boom Shroom (Orchid Mod).png (image) 1
{{image|#Boom Shroom}} Boom Shroom (Orchid Mod).png (image) 1