Changes

Jump to: navigation, search

Template:Icon

1,151 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<!-- Add mouseover title to help identify similar looking icons in the recipes table --> | banana water = item-icon-banana.png{{!}}BananaBottle of Water | beet roughtan = item-icon-beet.pngRough Tannin Powder{{!}}Beetlink=Rough Tannin Powder | butter decenttan = item-icon-butter.pngDecent Tannin Powder{{!}}Butterlink=Decent Tannin Powder | beet qualitytan = item-icon-grape.pngQuality Tannin Powder{{!}}Grapeslink=Quality Tannin Powder | lemon shoddy_animalskin = item-icon-banana.pngShoddy Animal Skin{{!}}Lemonlink=Shoddy Animal Skin | milk rough_animalskin = item-icon-milk.pngRough Animal Skin{{!}}Bottle of Milklink=Rough Animal Skin | orange crude_animalskin = item-icon-orange.pngCrude Animal Skin{{!}}Orangelink=Crude Animal Skin | potato decent_animalskin = item-icon-banana.pngDecent Animal Skin{{!}}Potatolink=Decent Animal Skin | redapple nice_animalskin = item-icon-redapple.pngNice Animal Skin{{!}}Red Applelink=Nice Animal Skin | salt quality_animalskin = item-icon-salt.pngQuality Animal Skin{{!}}Saltlink=Quality Animal Skin | sugar potato = item-icon-sugar.pngPotato{{!}}Sugarlink=Potato | water onionseedling = item-icon-water.pngOnion Seedling{{!}}Bottle of Waterlink=Onion Seedling
<!-- default uses the shop item naming convention -->
| #default = item-icon-{{#if:{{{1label|none}}}.png{{!}}|{{{1label}}}<!-- WTF? ==> if size not provided, try to get the icon name to show as red text when icon is missing, and otherwise show custom title above ==> if size is provided, then custom captions above don't work, short of using more complex templating due to caption not being a named param.-->}}|{{#ifucfirst: {{{size|1}}} | {{!}}{{{size}}} }}]]</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 Create an item icon with a mouseover tooltip that shows the full item name. The template has several purposescode does the following:* Makes some item certain icons link to relevant article pages instead of the default "File history" page (eg. Saltpeter).* It can save many edits in the futureSubstitute certain icons during alpha, for example certain foods that have when several items use the same icon now (eg. lemon uses banana & lemonicon), could have this is important so that the wiki article is specifying the proper icons. If/when these items get a unique icon later. The article refers to , only the individual foods, so substitution in the article won't need updatingtemplate needs to be removed.* Adds a mouseover titletooltip 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. <span style="color:redbanana">'''TODO'''</span>: add a mouseover popup with the title (very handy in recipes tables"Banana").* Reduces custom mediawiki Automatically provides a long name for common icons, eg. "water" => "Bottle of Water", which reduces code in the articlesarticle.
==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|lemon}}
</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|saltpetergenericpot|label=Advanced Holistic Ink}}
</pre>
[[Category:Formatting templates|ItemT]]</noinclude>

Navigation menu