Template:Icon

From Predecessor Wiki
Jump to navigation Jump to search
Template-info.svg Documentation
Lua.svg
This template uses Module:Icon (edit | hist), a script written in Lua.

Creates an inline icon with predefined sizes using data from Module:Icon/data.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
code1

The code of the desired icon. These can be found in the Module:Icon/data page.

Default
_DEFAULT
Example
{{Icon|platinum}}
Stringrequired
sizesize

A custom icon size. There are four predefined sizes: small (12px), normal (18px), medium (24px) and large (42px). While a custom size is an accepted value, it's recommended to use the predefined sizes for consistency across the wiki.

Suggested values
small normal medium large
Default
normal (18px)
Example
{{Icon|platinum|size=10px}}
Stringoptional
linklink

Determines whether the link specified in its data is displayed next to the icon as text. If yes, it will use the name data as its display name.

Suggested values
true yes
Default
no
Example
{{Icon|platinum|link=yes}}
Booleanoptional
texttext

Determines whether the name specified in its data is displayed next to the icon as text.

Default
no
Example
{{Icon|platinum|text=yes}}
Booleanoptional
colorcolor

Accepts an HTML color code which changes the color of the link and/or text.

Example
{{Icon|platinum|text=yes|color=#FFD700}}
Stringoptional
iconicon

Determines whether the icon is displayed. If no, there will be no icon, which allows for either text or link to be used on its own.

Default
yes
Example
{{Icon|platinum|icon=no|text=yes}}
Booleanoptional

Syntax

{{icon|<code>|<size>|<link>|<border>|<showlabel>|<text>|<labelstyle>|<image>}}

Examples

Markup Result
{{Icon|carry}} Icon Carry.png
{{Icon|carry|size=10px}} Icon Carry.png
{{Icon|carry|showlabel=true}} Icon Carry.png Carry
{{Icon|carry|showlabel=true|labelstyle=color: #FFD700}} Icon Carry.png Carry
{{Icon|carry|size=20px|showlabel=true|labelstyle=color: green; font-size:20px}} Icon Carry.png Carry