Advertisement

Icon

Template documentation (for the template shown above, sometimes hidden or invisible)

Template for displaying small icons.

Usage

{{icon|name of icon}}

Parameters

Required Icon required.png
<unnamed 1>

Which icon should be displayed. See below for the list of available options.

Optional Icon optional.png
(default: "normal")
<unnamed 2>

Specifies size of the icon. Can either be set to one of the presets below or directly given as a px value (same syntax as for setting image size of a normal file link).

The presets are:

  • normal: Icons will be displayed at 14px height.
  • big: Icons will be displayed at 20px height.
Optional Icon optional.png
link

Page the icon should link to (without enclosing "[[]]").

Optional Icon optional.png
tooltip

Tooltip text displayed when hovering over the icon. Overrides the icon's default text.

Available icons

Name(s) Icon
ability Ability Icon ability.png
ac, shieldbronze Armor class Icon shield bronze.png
action Action points Icon action.png
attack, crosshair Attack Icon attack.png
chance, percent Chance Icon chance.png
check, yes Yes
checkbrown, temporary Temporary
companion Companion Icon companion.png
cross, no No
cut Cut content Icon cut.png
damage Damage Icon damage.png
dead Dead Icon dead.png
defense, shieldsilver Defense Icon shield silver.png
detect, detection, eye Detection Icon eye.png
dial, dialogue Dialogue Icon dialogue.png
distance, range Distance Icon range.png
doctor Doctor Icon doctor.png
effect Effect Icon effect.png
electrical Electrical Icon electrical.png
Name(s) Icon
emp EMP Icon EMP.png
experience, xp Experience points Icon XP.png
explosion Explosion Icon explosion.png
fire Fire Icon fire.png
fist Fist Icon fist.png
gamerscore Xbox Live gamerscore Icon gamerscore.png
gas Gas Icon gas.png
gun Gun Icon gun.png
group Group Icon group.png
healing Healing Icon healing.png
health, heart, hp Health points Icon heart.png
image Image Icon image.png
info Information Icon info.png
laser Laser Icon laser.png
level Level Icon level.png
mac Macintosh Classic or Mac OS X Icon mac.png
macclassic Macintosh Classic (≤ MacOS 9) Icon mac.png
melee Melee Icon melee.png
merchant Merchant Icon merchant.png
Name(s) Icon
neutral Neutral Icon neutral.png
optional Optional Icon optional.png
pc PC Icon pc.png
plasma Plasma Icon plasma.png
poison Poison Icon poison.png
ps3 PlayStation 3 Icon ps3.png
ps3trophy PlayStation 3 trophy Icon ps3trophy.png
radiation Radiation Icon radiation.png
repair Repair Icon repair.png
repeat Repeat Icon repeat.png
required Required Icon required.png
semi-required Sometimes required or at least one required Icon semi-required.png
sequence Sequence Icon sequence.png
shieldgold Damage threshold Icon shield gold.png
sic In-game spelling, punctuation and/or grammar Icon sic.png
sound Sound Icon sound.png
spawn Spawned Icon spawn.png
text Text Icon text.png
xbox360 Xbox 360 Icon xbox360.png

In addition, all abbrevations supported by {{Abb}} can be used to produce an icon for the corresponding game.

Adding new icons

Simply add the following to the "ICON DEFINITIONS" section of the template and fill it out:

  -->|<!-- ICON NAME -->=<!--
   -->{{#vardefine:icon-image|<!-- FILE NAME -->}}<!--
   -->{{#vardefine:icon-tooltip|<!-- TOOLTIP TEXT -->}}<!--

Please note:

  • The icon name needs to be in all-lowercase.
  • File names should be specified without "File:" prefix.

In addition, please try to maintain alphabetical order of icon names within the template.

"High-use" icons

The template supports a special setup for "high-use" icons in order to minimize loading times and overcome certain technical limitations regarding the number of images on a given wiki page. Basically when this setup is used for an icon, the icon is rendered as a background image. As such, it requires manual additions to be made to MediaWiki:Common.css and should only be used for icons of which potentially very many are used on a given page.

To set up an icon as "high-use":

  • In the template, add a new row below the standard ones for file name and tooltip text which specifies the name of the icon's CSS class. All in all, the section for a high-use icon should look like this:
  -->|ICONNAME=<!--
   -->{{#vardefine:icon-image|FILENAME}}<!--
   -->{{#vardefine:icon-tooltip|TOOLTIPTEXT}}<!--
   -->{{#vardefine:icon-highuse|CLASSNAME}}<!--
CLASSNAME should be in all-lowercase. The template automatically prepends "va-icon-highuse-" to whatever you specify; e.g. if you set the variable to "example", the class name would end up being "va-icon-highuse-example".
  • On this documentation page, add a new row to the table below and replace all instances of "FILENAME" with the name of the file (without "File:").
|-
| [[File:FILENAME|x14px]]
| {{fileurl|FILENAME|x14px|url type=relative}}
| [[File:FILENAME|x20px]]
| {{fileurl|FILENAME|x20px|url type=relative}}
Normal-sized icon Big-sized icon
File PATH-NORMAL File PATH-BIG
Icon check.png .nocookie.net/wasteland_gamepedia/images/0/0f/Icon_check.png/revision/latest/scale-to-width-down/14?cb=20120317193844 Icon check.png .nocookie.net/wasteland_gamepedia/images/0/0f/Icon_check.png/revision/latest/scale-to-width-down/20?cb=20120317193844
Icon check temp.png .nocookie.net/wasteland_gamepedia/images/c/c3/Icon_check_temp.png/revision/latest/scale-to-width-down/14?cb=20120317195005 Icon check temp.png .nocookie.net/wasteland_gamepedia/images/c/c3/Icon_check_temp.png/revision/latest/scale-to-width-down/20?cb=20120317195005
Icon cross.png .nocookie.net/wasteland_gamepedia/images/e/e4/Icon_cross.png/revision/latest/scale-to-width-down/14?cb=20120317193912 Icon cross.png .nocookie.net/wasteland_gamepedia/images/e/e4/Icon_cross.png/revision/latest/scale-to-width-down/20?cb=20120317193912
  • In MediaWiki:Common.css, add the following to the "Template:Icon" section (preferably in the vicinity of the already existing high-use icons):
.va-icon-big .va-icon-highuse-CLASSNAME {
   background-image: url(PATH-NORMAL);
}
.va-icon-normal .va-icon-highuse-CLASSNAME {
   background-image: url(PATH-BIG);
}
Replace:
  • "CLASSNAME" with the value of the "icon-highuse" variable.
  • "PATH-NORMAL" with the content of the corresponding cell in the table above.
  • "PATH-BIG" with the content of the corresponding cell in the table above.

Examples

Input Result
{{icon|cut}} Cut content Icon cut.png
{{icon|cut|big}} Cut content Icon cut.png
{{icon|cut|link=Wasteland 2 Wiki}} Cut content Icon cut.png
{{icon|cut|tooltip=Custom tooltip}} Custom tooltip Icon cut.png

Technical

Documentation transcluded from Template:Icon/doc.
Community content is available under CC BY-NC-SA 3.0 unless otherwise noted.