Changes

Jump to: navigation, search

Template:Icon

2,220 bytes added, 20:19, 24 February 2017
m
no edit summary
<includeonly>[[File:item-icon-{{#switch:{{lc{1|}}}<!-- icon substitutions for lookalike items (in alpha) --> | lemon = banana | #default = {{{1|none}}}}}.png|class=js-icon-tt|{{#if:{{{1size|}}} |{{{size}}}{{!}}sub{{!}}}}{{#switch:{{{1|}}}<!-- icons with a custom wiki page destination set the item name based on icon name, and link for some --> | bottle = Empty Bottle | firedust = item-icon-firedust.pngFire Dust{{!}}link=Fire Dust | milk = Bottle of Milk | redapple = Red Apple | saltpeter = item-icon-saltpeter.pngSaltpeter{{!}}link=Saltpeter | sulfur = item-icon-sulfur.pngSulfur{{!}}link=Sulfur< | water = Bottle of Water | roughtan = Rough Tannin Powder{{!}}link=Rough Tannin Powder | decenttan = Decent Tannin Powder{{!}}link=Decent Tannin Powder | qualitytan = Quality Tannin Powder{{!}}link=Quality Tannin Powder | shoddy_animalskin = Shoddy Animal Skin{{!}}link=Shoddy Animal Skin | rough_animalskin = Rough Animal Skin{{!}}link=Rough Animal Skin | crude_animalskin = Crude Animal Skin{{!-- foods which have similar looking icons, using mouseover title -->}}link=Crude Animal Skin | butter decent_animalskin = item-icon-butter.pngDecent Animal Skin{{!}}Butterlink=Decent Animal Skin< | nice_animalskin = Nice Animal Skin{{!-- look-alike items for which we use the same icons (in alpha) -->}}link=Nice Animal Skin | lemon quality_animalskin = Quality Animal Skin{{!}}link= item-icon-banana.pngQuality Animal Skin | potato = item-icon-banana.pngPotato{{!}}link=Potato | onionseedling = Onion Seedling{{!}}link=Onion Seedling
<!-- default uses the shop item naming convention -->
| #default = item-icon-{{#if:{1{{label|none}}}.png|{{{label}}}|{{ucfirst:{{{size|32px1}}}}} }}}}]]</includeonly><noinclude>
__NOTOC__
Do not use this template. Use: [[Template:Item_icon]] instead.==SyntaxUsage==
<pre>
{{icon|<name>}}
{{icon|<name>|size=16px}}
{{icon|<name>|label=<full item name>}}
{{icon|<name>|size=16px|label=<full item name>}}
</pre>
==Description==
This template has several purposes:* Always used instead of direct links, it can save many edits in Create an item icon with a mouseover tooltip that shows the futurefull item name.* Reduces custom mediawiki The template code in does the articles.following:* Makes certain icons link to relevant article pages, instead of the default "File history" page(eg. Saltpeter).* Substitute certain icons during alpha, when several items use the same icon (eg. lemon uses banana icon), this is important so that the wiki article is specifying the proper icons. If/when these items get a unique icon, only the substitution in the template needs to be removed.* Adds a mouseover tooltip effect that display the full name of the item.* The capitalized icon name is the item name by default, which saves providing a separate item name for simple one-word items (eg. "banana" > "Banana").* Automatically provides a long name for common icons, eg. "water" => "Bottle of Water", which reduces code in the article.
==Parameters==
: Name of the icon. See [[Item Icons Guide]] for available icons (eg. "firstaid"). If not provided, an empty box is shown.
; size
: OPTIONAL. Changes the size of the icon (default is 32px).
 
; label
: OPTIONAL. Specify the image title, which also becomes a mouseover tooltip. Use this for long item names where the capitalized icon name does not match, and for items that use the same icon so the tooltip shows the correct item name (eg. "Advanced Holistic Ink" and "Basic Holistic Ink" which use the same icon).
==Examples==
Default 32x32px icon. By default the capitalized icon name becomes the tooltip: "lemon" => "Lemon".
<pre>
{{icon|saltpeterlemon}}
</pre>
 
Smaller inline icon.
<pre>
{{icon|saltpeter|size=16px}}
</pre>
 
Provide the full name for items that have similar looking icons with '''label''' parameter.
<pre>
{{icon|genericpot|label=Advanced Holistic Ink}}
</pre>
 
[[Category:Formatting templates|ItemT]]
</noinclude>

Navigation menu