Template:Item/doc: Difference between revisions

From Project Gorgon
Jump to navigation Jump to search
Donni Iris (talk | contribs)
Sample output: reorder by param name usage
Donni Iris (talk | contribs)
Sample output: add one example ; formatting
Line 22: Line 22:
| <nowiki>{{Item|Saltpeter}}</nowiki>
| <nowiki>{{Item|Saltpeter}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Saltpeter}}
| <!-- -->{{Item|Saltpeter}}
|}
 
:{| class="wikitable"
| Code
| {{=}}
| Output
|-
| <nowiki>{{Item|Fisherman's Arrangement #1}}</nowiki>
| &rArr;
| <!-- -->{{Item|Fisherman's Arrangement #1}}
|}
|}


Line 32: Line 42:
| <nowiki>{{Item|Fisherman's Arrangement #1|Fisherman's Arrangement 1}}</nowiki>
| <nowiki>{{Item|Fisherman's Arrangement #1|Fisherman's Arrangement 1}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Fisherman's Arrangement #1|Fisherman's Arrangement 1}}
| <!-- -->{{Item|Fisherman's Arrangement #1|Fisherman's Arrangement 1}}
|}
|}


Line 42: Line 52:
| <nowiki>{{Item|Beginner's Arrow|Learn Archery|Archery}}</nowiki>
| <nowiki>{{Item|Beginner's Arrow|Learn Archery|Archery}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Beginner's Arrow|Learn Archery|Archery}}
| <!-- -->{{Item|Beginner's Arrow|Learn Archery|Archery}}
|}
|}


Line 52: Line 62:
| <nowiki>{{Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}}</nowiki>
| <nowiki>{{Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}}
| <!-- -->{{Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}}
|}
|}


Line 62: Line 72:
| <nowiki>{{Item|Icon=Fisherman's Arrangement #1|Item name=Fisherman's Arrangement 1}}</nowiki>
| <nowiki>{{Item|Icon=Fisherman's Arrangement #1|Item name=Fisherman's Arrangement 1}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Icon=Fisherman's Arrangement #1|Item name=Fisherman's Arrangement 1}}
| <!-- -->{{Item|Icon=Fisherman's Arrangement #1|Item name=Fisherman's Arrangement 1}}
|}
|}


Line 72: Line 82:
| <nowiki>{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Archery}}</nowiki>
| <nowiki>{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Archery}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Archery}}
| <!-- -->{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Archery}}
|}
|}


Line 82: Line 92:
| <nowiki>{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Link=Archery}}</nowiki>
| <nowiki>{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Link=Archery}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Link=Archery}}
| <!-- -->{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Link=Archery}}
|}
|}


;Complex example
;Complex example
:Items with a # character in the name should be handled slightly differently, as the # character has special meanings in URLs, so items with a # character in the name are located at a page with that character removed (e.g. the page for Fisherman's Arrangement #1 is at [[Fisherman's Arrangement 1]]).
:Use alternate icon and link with alternate text.  Note usage of <kbd><nowiki>{{pipe}}</nowiki></kbd> to distinguish from normal template arguments:
:Use alternate icon and link with alternate text.  Note usage of <kbd><nowiki>{{pipe}}</nowiki></kbd> to distinguish from normal template arguments:
:{| class="wikitable"
:{| class="wikitable"
Line 94: Line 105:
| <nowiki>{{Item|Icon=Beginner's Arrow|Archery{{pipe}}Learn Archery}}</nowiki>
| <nowiki>{{Item|Icon=Beginner's Arrow|Archery{{pipe}}Learn Archery}}</nowiki>
| &rArr;
| &rArr;
| {{Item|Icon=Beginner's Arrow|Archery{{pipe}}Learn Archery}}
| <!-- -->{{Item|Icon=Beginner's Arrow|Archery{{pipe}}Learn Archery}}
|}
|}
;Items with a # character in the name should be handled slightly differently, as the # character has special meanings in URLs, so items with a # character in the name are located at a page with that character removed (e.g. the page for Fisherman's Arrangement #1 is at [[Fisherman's Arrangement 1]]).


== Notes ==
== Notes ==

Revision as of 15:57, 7 April 2026

Description

Use this template whenever you want the item icon and link (to the item's Wiki page) to display.
If the Item is to be displayed in a loot table for a monster, use Template:Loot instead.
If you only want to display an item's icon, or use a larger image of the icon, use the Item icon template.
If you need the icon for an ability, use the template for Ability icon.

Syntax

Type {{Item|Item name}} or {{Item|Icon|Item name}} where you want the item icon and link to display.

Parameters

Icon
OPTIONAL name of icon to use if different than item name.
Item name
The correct capitalized name of the item.

Sample output

Basic usage
Code = Output
{{Item|Saltpeter}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Code = Output
{{Item|Fisherman's Arrangement #1}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Code = Output
{{Item|Fisherman's Arrangement #1|Fisherman's Arrangement 1}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Code = Output
{{Item|Beginner's Arrow|Learn Archery|Archery}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Code = Output
{{Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Code = Output
{{Item|Icon=Fisherman's Arrangement #1|Item name=Fisherman's Arrangement 1}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Code = Output
{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Archery}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Code = Output
{{Item|Icon=Beginner's Arrow|Item name=Learn Archery|Link=Archery}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]
Complex example
Items with a # character in the name should be handled slightly differently, as the # character has special meanings in URLs, so items with a # character in the name are located at a page with that character removed (e.g. the page for Fisherman's Arrangement #1 is at Fisherman's Arrangement 1).
Use alternate icon and link with alternate text. Note usage of {{pipe}} to distinguish from normal template arguments:
Code = Output
{{Item|Icon=Beginner's Arrow|Archery{{pipe}}Learn Archery}} http://cdn.projectgorgon.com/v456/icons/icon_.png Error: Item not found }}
 
[[Expression error: Unrecognized punctuation character "{".]]

Notes

  • Uses the new Template:Item icon template.
  • WHY? To support enhancements in {{Vendor item row}} template.
  • This will break slightly when used on many flower arrangements and flower arrangement-related items, due to the # sign in the URL. See the example above for the workaround.