Changes

Jump to: navigation, search

Template:Icon

655 bytes added, 20:19, 24 February 2017
m
no edit summary
<includeonly>[[File:item-icon-{{#switch:{{lc:{{{1|}}}}}<!-- special case, "none" is mistaken as a horizontal alignment option icon substitutions for lookalike items (in alpha) --> | lemon = banana | #default = {{{1| none }}}}}.png|class= itemjs-icon-none.pngtt|{{#if: {{{size|}}} | {{{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-{{{1|none}}}.png{{!}}{{#if: {{{label|}}}|{{{label}}}|{{{1}}} }}<!-- 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|}}} | {{!}}{{{size1}}}{{!}}sub{{!}} }}]]</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:* Makes some Create an item icons link to relevant article pages instead of the default "File history" page (eg. Saltpeter).* It can save many edits in the future, for example certain foods that have the same icon now (banana & lemon), could have with a unique icon later. The article refers to the individual foods, so the article won't need updating.* Adds mouseover title.* Reduces custom mediawiki code in tooltip that shows the articlesfull item name.
<span style=The template code does the following:* Makes certain icons link to relevant article instead of the "color:redFile history">TODO<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/span>: laterwhen these items get a unique icon, this only the substitution in the template could automatically add needs to be removed.* Adds a javascript popup to show mouseover tooltip effect that display the full name of the item .* The capitalized icon nameis 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==
; label
: OPTIONAL. Give Specify the image title, which also becomes a mouseover tooltip text. Use this for long item names where the capitalized icon name does not match, and for items that have 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>
</pre>
Provide a title (mouseover) the full name for items that have similar looking iconswith '''label''' parameter.
<pre>
{{icon|genericpot|label=Advanced Holistic Ink}}
</pre>
 
 
[[Category:Formatting templates|ItemT]]
</noinclude>

Navigation menu