Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Icon

Template page
Revision as of 13:13, 16 July 2024 by ADAMJR (talk | contribs) (Create template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Template doc page transcluded    

This template can be used to add icons as generated by Template:Icon in front of words.

Use this template to standardise the order of elements in bonuses. It also suppresses alt text for improved accessibility.

Parameters

Parameter Description Required Default
1 The icon to use. For a list of icons see Template:Icon/doc. required none
2 Width of the icon
  • If preceded by an 'x', sets height instead of width
optional As defined by Template:Icon.

Typically either 24px or 52px.

3 String to insert between the icon and text optional none
4 Name of template to apply to parameter 3 (e.g. {{green}}) optional none
5 / text Text to display optional parameter 1
prefix / pre Text added to the front of parameter 1 for the purpose of determining the icon, but excluded from the displayed icon text. (e.g. ap) optional none
suffix / suf Text added to the end of parameter 1 for the purpose of determining the icon, but excluded from the displayed icon text. (e.g. tech) optional none
icon2 Inserts an additional icon image between the icon and text. optional none
icon3
icon4
icon5
tech Formats the icon text using Template:Tech with this parameter as the style.
  • Doesn't format text produced by parameter 3.
optional none
link Sets the link of the icon. Usable only with supported icons. optional none
hover Sets the hover text of the icon. Usable only with supported icons. optional none
nowrap If set to yes, keeps the icon and the text in the same line. optional no
sort If the icon is at the front of a cell in a sortable table, makes the cell sortable.
value of sort data-sort-key=" "
icon / icon1 the icon name, including the prefix and suffix parameters
icon2 the icon2 parameter
icon3 the icon3 parameter
icon4 the icon4 parameter
icon5 the icon5 parameter
yes the full displayed text, including parameter 3
text parameter 5 (or the text parameter) if defined, parameter 1 otherwise
default the sort parameter
optional none
cellstyle Requires sort. Adds cell styles in style="" optional none
rowspan / row Requires sort. Sets cell rowspan. optional 1
colpan / col Requires sort. Sets cell colspan. optional 1

Examples

Wiki text Produces
{{iconify|Militarist}} Militarist
{{iconify|Militarist|36px|<br>}}
Militarist
{{iconify|Militarist|icon2=Fanatic Militarist||Some degree of}} Some degree of Militarist
{{iconify|Fanatic Purifiers|icon2=Devouring Swarm|icon3=Determined Exterminator|text=Genocidal}} Genocidal
{{iconify|Minerals||+4}} +4 Minerals
{{iconify|Minerals||−4|red}} −4 Minerals
{{iconify|World Shaper}} Template:Icon/w World Shaper
{{iconify|World Shaper|pre=ap}} World Shaper
{{iconify|monthly influence|suf=add||+1|green}}

+1 monthly influence

{{iconify|Juggernaut|24px|suf=tech|tech=rare}} Template:Icon/j Template:Tech
{{iconify|admiral|24px}} admiral
{{iconify|admiral|x24px}} admiral
{{iconify|Militarist|sort=yes|cellstyle=text-align:center; background-color:green}} Militarist

List of available icons

Template:Main