Difference between revisions of "Template:Item/doc"
From Project: Gorgon Wiki
m (→Notes) |
m (Added a link to new template.) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
:Use this template whenever you want the item icon and link (to the item's Wiki page) to display. | :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 [[Template:Item_icon|Item icon]] template. | :If you only want to display an item's icon, or use a larger image of the icon, use the [[Template:Item_icon|Item icon]] template. | ||
:If you need the icon for an ability, use the template for [[Template:Ability_icon|Ability icon]]. | :If you need the icon for an ability, use the template for [[Template:Ability_icon|Ability icon]]. | ||
− | |||
== Syntax == | == Syntax == | ||
− | :Type <kbd>{{|Item|Item name}}</kbd> or <kbd>{{|Item|Item name | + | :Type <kbd>{{|Item|Item name}}</kbd> or <kbd>{{|Item|Icon|Item name}}</kbd> where you want the item icon and link to display. |
== Parameters == | == Parameters == | ||
Line 20: | Line 20: | ||
| Output | | Output | ||
|- | |- | ||
− | | {{ | + | | <nowiki>{{Item|Saltpeter}}</nowiki> |
| ⇒ | | ⇒ | ||
| {{Item|Saltpeter}} | | {{Item|Saltpeter}} | ||
|} | |} | ||
;Complex example | ;Complex example | ||
− | :Use alternate icon and link with alternate text. Note usage of {{ | + | :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" | ||
| Code | | Code | ||
Line 31: | Line 31: | ||
| Output | | Output | ||
|- | |- | ||
− | | {{ | + | | <nowiki>{{Item|Icon=Beginner's Arrow|Archery{{pipe}}Learn Archery}}</nowiki> |
| ⇒ | | ⇒ | ||
| {{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]]). | ||
+ | :{| class="wikitable" | ||
+ | | Code | ||
+ | | {{=}} | ||
+ | | Output | ||
+ | |- | ||
+ | | <nowiki>{{|Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}}</nowiki> | ||
+ | | ⇒ | ||
+ | | {{Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}} | ||
|} | |} | ||
== Notes == | == Notes == | ||
* Uses the new [[Template:Item icon]] template. | * Uses the new [[Template:Item icon]] template. | ||
− | * WHY? To support enhancements in {{ | + | * WHY? To support enhancements in <nowiki>{{Vendor item row}}</nowiki> 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. | * 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. | ||
<includeonly> | <includeonly> |
Latest revision as of 12:52, 20 April 2022
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}} ⇒
- Complex example
- 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}} ⇒
- 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).
Code = Output {{|Item|Icon=Fisherman's Arrangement #1|Fisherman's Arrangement 1}} ⇒
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.