Difference between revisions of "Template:Icon"

From Project: Gorgon Wiki
Jump to: navigation, search
m (Trying to fix the "none" icon DIV ("none" is also an image alignment parameter, hence the extra div))
m
Line 20: Line 20:
 
  | water    = item-icon-water.png{{!}}Bottle of Water
 
  | water    = item-icon-water.png{{!}}Bottle of Water
 
<!-- default uses the shop item naming convention -->
 
<!-- default uses the shop item naming convention -->
  | #default  = item-icon-{{{1|none}}}.png{{!}}{{{1}}}
+
  | #default  = item-icon-{{{1|none}}}.png{{!}}{{#if: {{{label|}}}|{{{label}}}|{{{1}}} }}
 
<!-- WTF?
 
<!-- 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 not provided, try to get the icon name to show as red text when icon is missing, and otherwise show custom title above  

Revision as of 10:21, 29 October 2014

{{{1}}}

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. TODO: add a mouseover popup with the title (very handy in recipes tables)
  • Reduces custom mediawiki code in the articles.

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).

Examples

{{icon|saltpeter}}