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}}}]]")
 
(First character is now always uppercase, also added some checks that will give back info whats gone wrong. so it's easier to use)
Line 1: Line 1:
[[{{#show: {{{1|Wood}}} | ?image | link = none }}|16px|link={{{1|Wood}}}]]
+
<onlyinclude>{{#vardefine: name    | {{ucfirst:{{{1|}}}
 +
}}}}{{#ifeq: {{#ifexist: {{#var:name}}| TRUE | FALSE}}| FALSE | [[{{#var:name}}]](Page does not exist)
 +
|{{#ifeq: {{#ifexist: {{#show: {{#var:name}} | ?image | link = none }}| TRUE | FALSE}}| FALSE | [[{{#var:name}}]] (Page has no "Image")
 +
|[[{{#show: {{#var:name}} | ?image | link = none }}|{{#if:{{{2|}}}|{{{2|}}}|16}}px|link={{#var:name}}]]
 +
}} }}</onlyinclude><noinclude>
 +
</br>
 +
== Description==
 +
Will give a small icon (16px default)</br>
 +
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 inproper used
 +
 
 +
== Usage ==
 +
<pre>{{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
 +
}}</pre>
 +
=== Examples ===
 +
Just an icon: {{Icon Small|steel}}
 +
<pre>{{Icon Small|steel}}</pre>
 +
 
 +
Icon with Size: {{Icon Small|Wood|32}}
 +
<pre>{{Icon Small|Wood|32}}</pre>
 +
</noinclude>

Revision as of 21:48, 7 September 2018

[[]](Page does not exist)

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 inproper 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
}}

Examples

Just an icon: Steel b.png

{{Icon Small|steel}}

Icon with Size: Woodlog b.png

{{Icon Small|Wood|32}}