Template:Icon

From The Vault - Fallout Wiki
Jump to: navigation, search
Template documentation (for the template shown above, sometimes hidden or invisible)

Template for displaying small icons.

Usage

{{icon|name of icon}}

Parameters

RequiredIcon required.png
<unnamed 1>

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

OptionalIcon 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.
OptionalIcon optional.png
link

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

OptionalIcon optional.png
tooltip

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

Available icons

Name(s) Icon
ability AbilityIcon ability.png
ac Armor classIcon shield bronze.png
action Action pointsIcon action.png
ap Action pointsIcon action.png
attack AttackIcon attack.png
buggedunavailable Not available due to bugsRadroach.png
caravan CardsIcon cards.png
cards CardsIcon cards.png
chance ChanceIcon chance.png
check Yes
checkbrown Temporary
companion CompanionIcon companion.png
confidence ConfidenceIcon confidence.png
cross No
crosshair AttackIcon attack.png
cut Cut contentIcon cut.png
damage DamageIcon damage.png
dead DeadIcon dead.png
defense Damage resistanceIcon shield silver.png
detect DetectionIcon eye.png
detection DetectionIcon eye.png
dial DialogueIcon dialogue.png
dialogue DialogueIcon dialogue.png
distance DistanceIcon range.png
doctor DoctorIcon doctor.png
dr Damage resistanceIcon shield silver.png
dt Damage thresholdIcon shield gold.png
effect EffectIcon effect.png
electrical ElectricalIcon electrical.png
emp EMPIcon EMP.png
enslave Can be enslavedIcon cage.png
essential EssentialIcon essential.png
experience Experience pointsIcon XP.png
explosion ExplosionIcon explosion.png
eye DetectionIcon eye.png
Name(s) Icon
fire FireIcon fire.png
fist FistIcon fist.png
fo4ballistic DamageFO4 ballistic icon.png
fo4dr Damage resistanceFO4DamageResistance.png
fo4energy EnergyFO4 energy icon.png
fo4er Energy resistanceFO4Energy.png
fo4pr Poison resistanceFO4Poison.png
fo4radiation RadiationFO4 radiation icon.png
fo4rr Radiation resistanceFO4Radiation.png
gamerscore Xbox Live gamerscoreIcon gamerscore.png
gas GasIcon gas.png
group GroupIcon group.png
gun GunIcon gun.png
healing Healing rateIcon healing.png
healing rate Healing rateIcon healing.png
health Health pointsIcon heart.png
heart Health pointsIcon heart.png
hp Health pointsIcon heart.png
image ImageIcon image.png
info InformationIcon info.png
js JSawyerSourcebox default.png
laser LaserIcon laser.png
level LevelIcon level.png
mac Macintosh Classic or Mac OS XIcon mac.png
macclassic Macintosh Classic (≤ MacOS 9)Icon mac.png
melee MeleeIcon melee.png
merchant MerchantIcon merchant.png
Name(s) Icon
neutral NeutralIcon neutral.png
no No
optional OptionalIcon optional.png
pc PCIcon pc.png
percent ChanceIcon chance.png
plasma PlasmaIcon plasma.png
poison PoisonIcon poison.png
ps3 PlayStation 3Icon ps3.png
ps3trophy PlayStation 3 trophyIcon ps3trophy.png
ps4 PlayStation 4Icon PS4.png
radiation RadiationIcon radiation.png
range DistanceIcon range.png
repair RepairIcon repair.png
repeat RepeatIcon repeat.png
required RequiredIcon required.png
semi-required Sometimes required or at least one requiredIcon semi-required.png
sequence SequenceIcon sequence.png
shieldbronze Armor classIcon shield bronze.png
shieldgold Damage thresholdIcon shield gold.png
shieldsilver Damage resistanceIcon shield silver.png
sic In-game spelling, punctuation and/or grammarIcon sic.png
sound SoundIcon sound.png
spawn SpawnedIcon spawn.png
temp Temporary
text TextIcon text.png
wild wasteland Wild WastelandPerk wild wasteland.png
ww Wild WastelandPerk wild wasteland.png
xbox360 Xbox 360Icon xbox360.png
xboxone Xbox OneIcon Xbox One.png
xp Experience pointsIcon XP.png
yes Yes

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/fallout_gamepedia/images/0/0f/Icon_check.png/revision/latest/scale-to-width-down/14?cb=20120501152055 Icon check.png nocookie.net/fallout_gamepedia/images/0/0f/Icon_check.png/revision/latest/scale-to-width-down/20?cb=20120501152055
Icon check temp.png nocookie.net/fallout_gamepedia/images/c/c3/Icon_check_temp.png/revision/latest/scale-to-width-down/14?cb=20120501154013 Icon check temp.png nocookie.net/fallout_gamepedia/images/c/c3/Icon_check_temp.png/revision/latest/scale-to-width-down/20?cb=20120501154013
Icon cross.png nocookie.net/fallout_gamepedia/images/e/e4/Icon_cross.png/revision/latest/scale-to-width-down/14?cb=20120501224716 Icon cross.png nocookie.net/fallout_gamepedia/images/e/e4/Icon_cross.png/revision/latest/scale-to-width-down/20?cb=20120501224716
  • 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 contentIcon cut.png
{{icon|cut|big}} Cut contentIcon cut.png
{{icon|cut|link=Fallout Wiki}} Cut contentIcon cut.png
{{icon|cut|tooltip=Custom tooltip}} Custom tooltipIcon cut.png

Technical

Documentation transcluded from Template:Icon/doc.