Template:Icon/doc: Difference between revisions

From Eco - English Wiki
[checked revision][checked revision]
No edit summary
Tag: 2017 source edit
No edit summary
Tag: 2017 source edit
Line 12: Line 12:
|-
|-
  | <code>name</code>
  | <code>name</code>
  | file name
  | item name
  | Cooking
  | Cooking
  | No file extension needed (assumes .png).
  |  
|-
|-
  | <code>style</code>
  | <code>style</code>
Line 20: Line 20:
  | 1
  | 1
  | Defines the (caption) style. Default is a small icon that is unlinkable with no caption.
  | Defines the (caption) style. Default is a small icon that is unlinkable with no caption.
* <code>1</code> = outputs the icon name as plain text next to the icon
* <code>1</code> = outputs no caption icon
* <code>2</code> = outputs the icon name as a small caption below the icon
* <code>2</code> = outputs the icon name as plain text next to the icon
* <code>3</code> = outputs no caption, but links the icon itself to its page of the same name. Recommended to use with <code>size</code> parameter
* <code>3</code> = outputs the icon name as a small caption below the icon
|-
|-
  | <code>link</code>
  | <code>link</code>
  | Page Name
  | Page Name or 1
  | Skills
  | Charred Meat
  | Optional. Use if you want the icon to also link to a page.
  | Optional. Use if you want the icon to also link to a page.
*  When set to the default of 1, it will link to the same name as the icon, but you can overwrite by writing in the designated page name in this field. If you are using this, you must write out <code>link=</code>
*  When set to the default of 1, it will link to the same name as the item, but you can overwrite by writing in the designated page name in this field. If you are using this, you must write out <code>link=</code>
|-
|-
  | <code>size</code>
  | <code>size</code>
  | any px size
  | any px size
  | {{formatnum: 50}}
  | 50
  | If you are using this, you must write out <code>size=</code> and assumes <code>px</code>.
  | If you are using this, you must write out <code>size=</code> and assumes <code>px</code>.
|}
|}
Line 42: Line 42:
  ! Result
  ! Result
|-
|-
  | No Style, Size 100px
  | Style 1, Size 100px, no link
  | <syntaxhighlight lang="mediawiki">{{Icon|name=Charred Meat|size=100}}</syntaxhighlight>
  | <syntaxhighlight lang="mediawiki">{{Icon|name=Charred Meat|size=100}}</syntaxhighlight>
  | {{Icon|name=Charred Meat|size=100}}
  | {{Icon|name=Charred Meat|size=100}}
|-
| Style 1
| <syntaxhighlight lang="mediawiki">{{Icon|ChefSkill|1}}</syntaxhighlight>
| {{Icon|ChefSkill|1}}
|-
| Style 1 with link to its page
| <syntaxhighlight lang="mediawiki">{{Icon|ChefSkill|1|1}}</syntaxhighlight>
| {{Icon|ChefSkill|1|1}}
|-
| Style 2
| <syntaxhighlight lang="mediawiki">{{Icon|ChefSkill|2}}</syntaxhighlight>
| {{Icon|ChefSkill|2}}
|-
| Style 2 with link to Skills page
| <syntaxhighlight lang="mediawiki">{{Icon|ChefSkill|2|Skills}}</syntaxhighlight>
| {{Icon|ChefSkill|2|Skills}}
|-
| Style 2, Size 100px
| <syntaxhighlight lang="mediawiki">{{Icon|ChefSkill|2|size=100}}</syntaxhighlight>
| {{Icon|ChefSkill|2|size=100}}
|-
| Style 3, different link, Size 80px
| <syntaxhighlight lang="mediawiki">{{Icon|ChefSkill|3|Skills|size=80}}</syntaxhighlight>
| {{Icon|ChefSkill|3|link=Skills|size=80}}
|}
|}


<noinclude>[[Category:Template Docs]]</noinclude>
<noinclude>[[Category:Template Docs]]</noinclude>

Revision as of 10:16, 14 June 2024

Description

Use to create tiny icons (and captions). By default, the icon size is 28px but it can be re-defined.

Syntax

{{Icon|name|style|link|size}}
Field Accepted Parameters Example Notes
name item name Cooking
style 1,2,3 1 Defines the (caption) style. Default is a small icon that is unlinkable with no caption.
  • 1 = outputs no caption icon
  • 2 = outputs the icon name as plain text next to the icon
  • 3 = outputs the icon name as a small caption below the icon
link Page Name or 1 Charred Meat Optional. Use if you want the icon to also link to a page.
  • When set to the default of 1, it will link to the same name as the item, but you can overwrite by writing in the designated page name in this field. If you are using this, you must write out link=
size any px size 50 If you are using this, you must write out size= and assumes px.

Samples

Example Syntax Result
Style 1, Size 100px, no link
{{Icon|name=Charred Meat|size=100}}
Module:IconUtils 'name' must be specified.