Template:Im
Description
{{im}}
is an icon-link (meta)-template.
It can be used to create a variety of icon templates, but, due to its short one letter parameters, nothing prevents it from being used directly on articles.
Editors can create new templates based on {{im}}
without ever having to come here to edit this meta-template.
It should be use for all types of items.
For creatures, use the {{ii}}
.
Syntax
Here are some of the possibilities:
{{im|IMAGENAME}}
|
icon + tip (taken from image name) |
{{im|IMAGENAME|$tip=?}}
|
icon + custom tip |
{{im|IMAGENAME|$l}}
|
icon link (taken from image name) |
{{im|IMAGENAME|$l=?}}
|
icon link (custom target) |
{{im|IMAGENAME|$t}}
|
icon + text (taken from image name) |
{{im|IMAGENAME|$t=?}}
|
icon + custom text |
{{im|IMAGENAME|$l|$t}}
|
icon link + text link (taken from image name) |
{{im|IMAGENAME|$l=?|$t}}
|
icon + text (custom target) |
{{im|IMAGENAME|$l|$t=?}}
|
icon link + custom text link |
{{im|IMAGENAME|$l=?|$t=?}}
|
icon link + custom text link (custom target) |
{{im|IMAGENAME|$s=?px}}
|
custom size of the icon (default is 18px) |
{{im|IMAGENAME|$f=EXT}}
|
files with extension other than .PNG |
{{im|IMAGENAME|$t|$b=?px}}
|
vertical adustment between image and text |
Parameters
Required
- 1st unnamed
This is the icon being used and what will define the text and the link, if activated by the following parameters.
Optional
- 2nd and 3rd unnamed
These 2 unnamed parameters are reserved to:
|l
if used, the image/icon will have a link; and|t
if used, the icon will be followed by a text link.
If both are used, |l
shall always come before |t
. Never: {{im|IMAGE|t|l}}
.
Note that the icon and the linked article shall have the same name. The image file can be renamed to match the article name, redirect pages may be used to fill the gap (see the example bellow: there is no article named "Tricky Toki Statue", but there is a redirect page), or use |l=?
for a custom target.|t=?
provides a text different from the image name.
- s=?px
Customizes the size of the icon (e.g.: |s=30px
, default is 18px).
- tip=?
Customizes the tooltip over icons without text or links.
- f=EXT
Specify the file type (extension) if it's different from .png
. If the image is a GIF, JPG, SVG, or any supported image type other than PNG, this parameter should be used.
- b=?px
Refines the vertical position of the icon with a distance from the bottom in pixels.
The default is 2px
. It accepts positive and negative values.
Samples
Source | Result | Comment |
---|---|---|
{{im|Tricky Toki Statue}} |
![]() |
With no optional parameters. Icon displayed with no link. Tooltip displayed when hovering the mouse. |
{{im|Tricky Toki Statue |tip=Don't point at me!}} |
![]() |
With a custom tooltip. |
{{im|Tricky Toki Statue|l}} |
![]() |
Icon linking to the related page. |
{{im|Tricky Toki Statue|t}} |
![]() |
Icon + text. |
{{im|Tricky Toki Statue |t=The Statue}} |
![]() |
Icon + custom text. |
{{im|Tricky Toki Statue|l|t}} |
![]() |
Icon link + text link. |
{{im|Tricky Toki Statue |l=:Category:Furniture|t}} |
![]() |
Icon link + text link (custom target). |
{{im|Tricky Toki Statue|l |t=The Best Statue}} |
![]() |
Icon link + custom text link. |
{{im|Tricky Toki Statue |l=:Category:Furniture |t=The Best Statue}} |
![]() |
Icon link + custom text link (custom target). |
{{im|Tricky Toki Statue|t|b=6px}} |
![]() |
Added "6px" for vertical adjustment. (default is "2px"). |
{{im|Tricky Toki Statue|t|s=30px}} |
![]() |
Icon with a custom size (default is "18px"). |
{{im|WaterBags block|f=gif |s=22px|tip=Filling with water}} [[Water]] |
![]() |
Using a gif icon. |
Technicalities
Unlike [[File:{{{1}}}.png|
20px|
link=]]
, this one does not use the expensive function call #ifexist
.