Difference between revisions of "Template:Icon Small"

From RimWorld Wiki
Jump to navigation Jump to search
(Created page with "[[{{#show: {{{1|Wood}}} | ?image | link = none }}|16px|link={{{1|Wood}}}]]")
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[{{#show: {{{1|Wood}}} | ?image | link = none }}|16px|link={{{1|Wood}}}]]
+
<includeonly>{{#vardefine: iconname    | {{ucfirst:{{{1|}}}
 +
}}}}{{#ifeq: {{#ifexist: {{#var:iconname}}| TRUE | FALSE}}| FALSE | [[{{#var:iconname}}]](Page does not exist)
 +
|{{#ifeq: {{#ifexist: {{#show: {{#var:iconname}} | ?image | link = none }}| TRUE | FALSE}}| FALSE | [[{{#var:iconname}}]] (Page has no "Image")
 +
|[[{{#show: {{#var:iconname}} | ?image | link = none }}|{{#if:{{{2|}}}|{{{2|}}}|16}}px|link={{#var:iconname}}]]
 +
}} }}</includeonly><noinclude>
 +
{{documentation}}
 +
</noinclude>

Revision as of 04:31, 6 June 2021

Documentation icon Template documentation[view] [edit] [history] [purge]

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

Just an icon: Steel b.png

{{Icon Small|steel}}

Icon with Size: Woodlog b.png

{{Icon Small|Wood|32}}

Icon with Amount: Potatoes.png

{{Icon Small|Potatoes||10}}

Icon with Size and Amount: Chemfuel.png

{{Icon Small|Chemfuel|32|150}}