Template:Icon
Template for displaying small icons.
Usage
{{icon|name of icon}}
Parameters
Which icon should be displayed. See below for the list of available options.
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.
Page the icon should link to (without enclosing "[[]]").
Tooltip text displayed when hovering over the icon. Overrides the icon's default text.
Available icons
Name(s) | Icon |
---|---|
ability | |
ac, shieldbronze | |
action, ap | |
attack, crosshair | |
caravan, cards | |
chance, percent | |
check, yes | |
checkbrown, temporary | |
companion | |
confidence | |
cross, no | |
cut | |
damage | |
dead | |
defense, dr, shieldsilver | |
detect, detection, eye | |
dial, dialogue | |
distance, range | |
doctor | |
dt, shieldgold | |
effect |
Name(s) | Icon |
---|---|
electrical | |
emp | |
enslave | |
essential | |
experience, xp | |
explosion | |
fire | |
fist | |
gamerscore | |
gas | |
gun | |
group | |
healing, healing rate | |
health, heart, hp | |
image | |
info | |
laser | |
level | |
mac | |
macclassic | |
melee |
Name(s) | Icon |
---|---|
merchant | |
neutral | |
optional | |
pc | |
plasma | |
poison | |
ps3 | |
ps3trophy | |
radiation | |
repair | |
repeat | |
required | |
semi-required | |
sequence | |
sic | |
sound | |
spawn | |
text | |
wild wasteland, ww | |
xbox360 |
Template:Clear 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}}<!--
- 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 |
x14px | Template:Fileurl | x20px | Template:Fileurl |
x14px | Template:Fileurl | x20px | Template:Fileurl |
x14px | Template:Fileurl | x20px | Template:Fileurl |
- 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); }
- "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}}
|
|
{{icon|cut|big}}
|
|
{{icon|cut|link=Fallout Wiki}}
|
|
{{icon|cut|tooltip=Custom tooltip}}
|
Technical
- Extension used: Variables