Template:Icon: Difference between revisions
Create template |
No edit summary |
||
| Line 1: | Line 1: | ||
<includeonly>{{icon/{{padleft:|1|{{lc:{{{1}}}}}}}|{{lc:{{{1}}}}}|w{{#if:{{{2|}}}||NULL}}={{{2}}}}}</includeonly><noinclude | <!-- Copied from https://stellaris.paradoxwikis.com/Template:Icon under CC BY-SA 3.0 --> | ||
<includeonly>{{icon/{{padleft:|1|{{lc:{{{1}}}}}}}|{{lc:{{{1}}}}}|w{{#if:{{{2|}}}||NULL}}={{{2}}}}}</includeonly><noinclude> | |||
{{Icon/doc}}<!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> | {{Icon/doc}}<!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> | ||
Revision as of 22:51, 17 July 2024
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
|
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.
|
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.
|
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}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}Militarist{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Militarist| yes = {{#if:|{{{3}}} }}Militarist| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}militarist{{#if:| }}|w{{#if:||NULL}}=}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|Militarist}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|Militarist|36px|<br>}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}Militarist{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Militarist| yes = {{#if: | }}Militarist| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }} {{icon/{|{{#if:|{{{pre}}} }}militarist{{#if:| }}|w{{#if:36px||NULL}}=36px}}{{#if:|
{{icon/{|{{{icon2}}}|w{{#if:36px||NULL}}=36px}}}}{{#if:|
{{icon/{|{{{icon3}}}|w{{#if:36px||NULL}}=36px}}}}{{#if:|
{{icon/{|{{{icon4}}}|w{{#if:36px||NULL}}=36px}}}}{{#if:|
{{icon/{|{{{icon5}}}|w{{#if:36px||NULL}}=36px}}}}{{#if: | ||||||||
{{iconify|Militarist|icon2=Fanatic Militarist||Some degree of}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}Militarist{{#if:| }}| icon2 = Fanatic Militarist| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Militarist| yes = {{#if:Some degree of|Some degree of }}Militarist| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}militarist{{#if:| }}|w{{#if:||NULL}}=}}{{#if:Fanatic Militarist| {{#switch:fanatic militarist |
food = |
frigate = }}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:Some degree of| {{#if:|{{{{{4}}}|Some degree of}}|Some degree of}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|Militarist}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||
{{iconify|Fanatic Purifiers|icon2=Devouring Swarm|icon3=Determined Exterminator|text=Genocidal}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}Fanatic Purifiers{{#if:| }}| icon2 = Devouring Swarm| icon3 = Determined Exterminator| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Genocidal| yes = {{#if:|{{{3}}} }}Genocidal| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}fanatic purifiers{{#if:| }}|w{{#if:||NULL}}=}}{{#if:Devouring Swarm| {{#switch:devouring swarm |
double_cooperative = |
double_isolationist = |
double_militarist = |
double_pacifist = }}}}{{#if:Determined Exterminator| {{#switch:determined exterminator |
double_cooperative = |
double_isolationist = |
double_militarist = |
double_pacifist = }}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|Genocidal}}{{#switch:{{{nowrap}}}|yes|full=}} |
{{iconify|Minerals||+4}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}Minerals{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Minerals| yes = {{#if:+4|+4 }}Minerals| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}minerals{{#if:| }}|w{{#if:||NULL}}=}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:+4| {{#if:|{{{{{4}}}|+4}}|+4}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|Minerals}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|Minerals||−4|red}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}Minerals{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Minerals| yes = {{#if:−4|−4 }}Minerals| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}minerals{{#if:| }}|w{{#if:||NULL}}=}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:−4| {{#if:red| {{#ifeq:−4|-−4|−−4|−4}}|−4}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|Minerals}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|World Shaper}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}World Shaper{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = World Shaper| yes = {{#if:|{{{3}}} }}World Shaper| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}world shaper{{#if:| }}|w{{#if:||NULL}}=}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|World Shaper}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|World Shaper|pre=ap}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:ap|ap }}World Shaper{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = World Shaper| yes = {{#if:|{{{3}}} }}World Shaper| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:ap|ap }}world shaper{{#if:| }}|w{{#if:||NULL}}=}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|World Shaper}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|monthly influence|suf=add||+1|green}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}monthly influence{{#if:add| add}}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = monthly influence| yes = {{#if:+1|+1 }}monthly influence| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}monthly influence{{#if:add| add}}|w{{#if:||NULL}}=}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:+1| {{#if:green| {{#switch: + |
1}} | 1}} | #default = +1
}}|+1}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|monthly influence}}{{#switch:{{{nowrap}}}|yes|full=}}
| |||||
{{iconify|Juggernaut|24px|suf=tech|tech=rare}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}Juggernaut{{#if:tech| tech}}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Juggernaut| yes = {{#if:|{{{3}}} }}Juggernaut| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}juggernaut{{#if:tech| tech}}|w{{#if:24px||NULL}}=24px}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:rare|Template:Tech|Juggernaut}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|admiral|24px}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}admiral{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = admiral| yes = {{#if:|{{{3}}} }}admiral| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}admiral{{#if:| }}|w{{#if:24px||NULL}}=24px}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:24px||NULL}}=24px}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|admiral}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|admiral|x24px}} |
data-sort-value="{{#switch:{{{sort}}}| icon | icon1 = {{#if:| }}admiral{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = admiral| yes = {{#if:|{{{3}}} }}admiral| {{{sort}}}}}" style=";" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}admiral{{#if:| }}|w{{#if:x24px||NULL}}=x24px}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:x24px||NULL}}=x24px}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:x24px||NULL}}=x24px}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:x24px||NULL}}=x24px}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:x24px||NULL}}=x24px}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|admiral}}{{#switch:{{{nowrap}}}|yes|full=}} | ||||||||
{{iconify|Militarist|sort=yes|cellstyle=text-align:center; background-color:green}} |
data-sort-value="{{#switch:yes| icon | icon1 = {{#if:| }}Militarist{{#if:| }}| icon2 = {{{icon2}}}| icon3 = {{{icon3}}}| icon4 = {{{icon4}}}| icon5 = {{{icon5}}}| text = Militarist| yes = {{#if:|{{{3}}} }}Militarist| yes}}" style="text-align:center; background-color:lightgreen;" rowspan="1" colspan="1" |}}{{#switch:{{{nowrap}}}|yes|full= |#default = }}
{{icon/{|{{#if:|{{{pre}}} }}militarist{{#if:| }}|w{{#if:||NULL}}=}}{{#if:| {{icon/{|{{{icon2}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon3}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon4}}}|w{{#if:||NULL}}=}}}}{{#if:| {{icon/{|{{{icon5}}}|w{{#if:||NULL}}=}}}}{{#if:| {{#if:|{{{{{4}}}|{{{3}}}}}|{{{3}}}}}}}{{#switch:{{{5}}}| = |#default = }}{{#if:|Template:Tech|Militarist}}{{#switch:{{{nowrap}}}|yes|full=}} |