Difference between revisions of "Template:Icon"
From Project: Gorgon Wiki
Gorgonzola (talk | contribs) m (WIP) |
Gorgonzola (talk | contribs) (Documentation of usage of the "label" parameter.) |
||
Line 5: | Line 5: | ||
}}.png|class=js-icon-tt|{{#if: {{{size|}}} | {{{size}}}{{!}}sub{{!}} }}{{#switch:{{{1|}}} | }}.png|class=js-icon-tt|{{#if: {{{size|}}} | {{{size}}}{{!}}sub{{!}} }}{{#switch:{{{1|}}} | ||
<!-- set the item name based on icon name, and link for some --> | <!-- set the item name based on icon name, and link for some --> | ||
+ | | bottle = Empty Bottle | ||
| firedust = Fire Dust{{!}}link=Fire Dust | | firedust = Fire Dust{{!}}link=Fire Dust | ||
+ | | milk = Bottle of Milk | ||
+ | | redapple = Red Apple | ||
| saltpeter = Saltpeter{{!}}link=Saltpeter | | saltpeter = Saltpeter{{!}}link=Saltpeter | ||
| sulfur = Sulfur{{!}}link=Sulfur | | sulfur = Sulfur{{!}}link=Sulfur | ||
− | |||
− | |||
| water = Bottle of Water | | water = Bottle of Water | ||
<!-- default uses the shop item naming convention --> | <!-- default uses the shop item naming convention --> | ||
Line 21: | Line 22: | ||
==Description== | ==Description== | ||
− | + | Create an item icon with a mouseover tooltip that shows the full item name. | |
− | |||
− | |||
− | |||
− | |||
− | + | The template code does the following: | |
+ | * Makes certain icons link to relevant article instead of the "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== | ==Parameters== | ||
Line 37: | Line 39: | ||
; label | ; label | ||
− | : OPTIONAL. | + | : 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== | ==Examples== |
Revision as of 17:08, 29 October 2014
Syntax
{{icon|<name>|size=16px}}
Description
Create an item icon with a mouseover tooltip that shows the full item name.
The template code does the following:
- Makes certain icons link to relevant article instead of the "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
- parameter 1
- 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".
{{icon|lemon}}
Smaller inline icon.
{{icon|saltpeter|size=16px}}
Provide the full name for items that have similar looking icons with label parameter.
{{icon|genericpot|label=Advanced Holistic Ink}}