Difference between revisions of "Template:Icon"
From Project: Gorgon Wiki
Gorgonzola (talk | contribs) m |
Gorgonzola (talk | contribs) m (Documentation of new "label" parameter.) |
||
Line 36: | Line 36: | ||
* Makes some item icons link to relevant article pages instead of the default "File history" page (eg. Saltpeter). | * Makes some 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 a unique icon later. The article refers to the individual foods, so the article won't need updating. | * It can save many edits in the future, for example certain foods that have the same icon now (banana & lemon), could have a unique icon later. The article refers to the individual foods, so the article won't need updating. | ||
− | * Adds mouseover title. | + | * Adds mouseover title. |
* Reduces custom mediawiki code in the articles. | * Reduces custom mediawiki code in the articles. | ||
+ | |||
+ | <span style="color:red">TODO</span>: later, this template could automatically add a javascript popup to show the full item name. | ||
==Parameters== | ==Parameters== | ||
Line 43: | Line 45: | ||
: Name of the icon. See [[Item Icons Guide]] for available icons (eg. "firstaid"). If not provided, an empty box is shown. | : Name of the icon. See [[Item Icons Guide]] for available icons (eg. "firstaid"). If not provided, an empty box is shown. | ||
− | ; size | + | ; size |
: OPTIONAL. Changes the size of the icon (default is 32px). | : OPTIONAL. Changes the size of the icon (default is 32px). | ||
+ | |||
+ | ; label | ||
+ | : OPTIONAL. Give the mouseover tooltip text, for items that have the same icon. | ||
==Examples== | ==Examples== | ||
+ | Default 32x32px icon. | ||
<pre> | <pre> | ||
{{icon|saltpeter}} | {{icon|saltpeter}} | ||
</pre> | </pre> | ||
+ | |||
+ | Smaller inline icon. | ||
+ | <pre> | ||
+ | {{icon|saltpeter|size=16px}} | ||
+ | </pre> | ||
+ | |||
+ | Provide a title (mouseover) for items that have similar icons. | ||
+ | <pre> | ||
+ | {{icon|genericpot|label=Advanced Holistic Ink}} | ||
+ | </pre> | ||
+ | |||
+ | |||
[[Category:Formatting templates|ItemT]] | [[Category:Formatting templates|ItemT]] | ||
</noinclude> | </noinclude> |
Revision as of 09:26, 29 October 2014
Syntax
{{icon|<name>|size=16px}}
Description
This template has several purposes:
- Makes some 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 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 the articles.
TODO: later, this template could automatically add a javascript popup to show the full item name.
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. Give the mouseover tooltip text, for items that have the same icon.
Examples
Default 32x32px icon.
{{icon|saltpeter}}
Smaller inline icon.
{{icon|saltpeter|size=16px}}
Provide a title (mouseover) for items that have similar icons.
{{icon|genericpot|label=Advanced Holistic Ink}}