Difference between revisions of "Template:Icon Small"
Jump to navigation
Jump to search
(always display amount; error message formatting; simplification; source text formatting) |
m (like Template:RoyaltyIcon etc) |
||
Line 1: | Line 1: | ||
− | <includeonly>{{#ifeq: {{#ifexist: {{#vardefineecho: iconname | {{ucfirst: {{{1|}}} }} }} | TRUE | FALSE}} | + | <includeonly><sup>{{#ifeq: {{#ifexist: {{#vardefineecho: iconname | {{ucfirst: {{{1|}}} }} }} | TRUE | FALSE}} |
| FALSE | [[{{#var:iconname}}]] {{Error|(Error: Page does not exist)}} | | FALSE | [[{{#var:iconname}}]] {{Error|(Error: Page does not exist)}} | ||
| {{#ifeq: {{#if: {{#show: {{#var:iconname}} | ?image | link = none }} | TRUE | FALSE}} | | {{#ifeq: {{#if: {{#show: {{#var:iconname}} | ?image | link = none }} | TRUE | FALSE}} | ||
Line 5: | Line 5: | ||
| [[{{#show: {{#var:iconname}} | ?image | link = none }}|{{#if:{{{2|}}}|{{{2|}}}|16}}px|{{#var:iconname}}|link={{#ifeq: {{#var:iconname}}|{{PAGENAME}}||{{#var:iconname}}}}]] | | [[{{#show: {{#var:iconname}} | ?image | link = none }}|{{#if:{{{2|}}}|{{{2|}}}|16}}px|{{#var:iconname}}|link={{#ifeq: {{#var:iconname}}|{{PAGENAME}}||{{#var:iconname}}}}]] | ||
}} | }} | ||
− | }}{{#if:{{{3|}}}| {{{3|}}}}}</includeonly><noinclude> | + | }}</sup>{{#if:{{{3|}}}| {{{3|}}}}}</includeonly><noinclude> |
{{documentation}} | {{documentation}} | ||
</noinclude> | </noinclude> |
Revision as of 17:22, 15 September 2022
Description
Will give a small icon (16px default)
Image is taken from the page, so all pages that have a image should be able to display an icon of it.
There are checks that will give some feedback when improper used
Usage
{{Icon Small | name <-- determines image displayed, is a Pagename that has an image | image size (optional, 16px resize by default) has to be an integer | amount (optional) }}
Examples
{{Icon Small|steel}}
{{Icon Small|Wood|32}}
{{Icon Small|Potatoes||10}}
Icon with Size and Amount: 150
{{Icon Small|Chemfuel|32|150}}
The above documentation is transcluded from Template:Icon Small/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |