Difference between revisions of "Template:Icon Small"

From RimWorld Wiki
Jump to navigation Jump to search
(First character is now always uppercase, also added some checks that will give back info whats gone wrong. so it's easier to use)
m (Changed protection level for "Template:Icon Small": protection no longer required ([Edit=Allow only autoconfirmed users] (expires 20:17, 1 February 2023 (UTC)) [Move=Allow only autoconfirmed users] (expires 20:17, 1 February 2023 (UTC))))
 
(17 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<onlyinclude>{{#vardefine: name    | {{ucfirst:{{{1|}}}
+
<includeonly>{{#ifeq: {{#ifexist: {{#vardefineecho: iconname | {{ucfirst: {{{1|}}} }} }} | TRUE | FALSE}}
}}}}{{#ifeq: {{#ifexist: {{#var:name}}| TRUE | FALSE}}| FALSE | [[{{#var:name}}]](Page does not exist)
+
  | FALSE | [[{{#var:iconname}}]] {{Error|(Error: Page does not exist)}}
|{{#ifeq: {{#ifexist: {{#show: {{#var:name}} | ?image | link = none }}| TRUE | FALSE}}| FALSE | [[{{#var:name}}]] (Page has no "Image")  
+
  | {{#ifeq: {{#if: {{#show: {{#var:iconname}} | ?image | link = none }} | TRUE | FALSE}}  
|[[{{#show: {{#var:name}} | ?image | link = none }}|{{#if:{{{2|}}}|{{{2|}}}|16}}px|link={{#var:name}}]]
+
    | FALSE | [[{{#var:iconname}}]] {{Error|(Error: Page has no [[Property:Image]])}}
}} }}</onlyinclude><noinclude>
+
    | [[{{#show: {{#var:iconname}} | ?image | link = none }}|{{#if:{{{2|}}}|{{{2|}}}|16}}px|{{#var:iconname}}|link={{#ifeq: {{#var:iconname}}|{{PAGENAME}}||{{#var:iconname}}}}]]
</br>
+
  }}
== Description==
+
}}{{#if:{{{3|}}}|&nbsp;{{{3|}}}}}</includeonly><noinclude>
Will give a small icon (16px default)</br>
+
{{documentation}}
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>
 
</noinclude>

Latest revision as of 19:17, 1 February 2023

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

Description[edit]

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[edit]

{{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[edit]

Just an icon: Steel

{{Icon Small|steel}}

Icon with Size: Wood

{{Icon Small|Wood|32}}

Icon with Amount: Potatoes 10

{{Icon Small|Potatoes||10}}

Icon with Size and Amount: Chemfuel 150

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