10,109
edits
m
no edit summary
(add in-text example) |
mNo edit summary |
||
(18 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>''This text is transcluded from [[Template: | <includeonly>''This text is transcluded from [[Template:Item icon/doc]].''</includeonly> | ||
<div class="bg3wiki-tooltip-box">{{Center|{{ItemIcon|name=Bex's handmade cookies|show_name=t|show_rarity=t}}}}</div> | |||
This template fetches and displays an icon for an item. The information is uploaded using the standard item descriptions. Use [[Template:ItemIcon Insert]] to add a page that doesn't use [[Template:MiscItemPage]], [[Template:EquipmentPage]], or [[Template:WeaponPage]]. | This template fetches and displays an icon for an item. The information is uploaded using the standard item descriptions. Use [[Template:ItemIcon Insert]] to add a page that doesn't use [[Template:MiscItemPage]], [[Template:EquipmentPage]], or [[Template:WeaponPage]]. | ||
Line 5: | Line 6: | ||
Usage: <pre>{{ItemIcon | Usage: <pre>{{ItemIcon | ||
|name=the name of the icon page | |name=the name of the icon page | ||
|uid=(optional) If specified, will search for this UID instead of the page name. | |||
|size=(optional) the size of the icon | |size=(optional) the size of the icon | ||
|show_name=(optional) Whether to show the name. Any value will show the name of the item as a link. Omit to hide it. | |show_name=(optional) Whether to show the name. Any value will show the name of the item as a link. Omit to hide it. | ||
|show_rarity=(optional) Whether to add a border and background to the icon according to the item's rarity. Omit to not show it. | |show_rarity=(optional) Whether to add a border and background to the icon according to the item's rarity. Omit to not show it. | ||
|no_padding=(optional) If specified, does not insert margin to the left and right of the ItemIcon. Recommended for use in tables, lists, and start of paragraphs. | |||
|override_icon=(optional) If specified, skips looking up the Cargo table and inserts the specified icon directly. Must also specify '''override_rarity'''. | |||
|override_rarity=(optional) When specified with '''override_icon''', will set the rarity of the displayed item. | |||
|alias=(optional) If specified, the link text will be this instead. | |||
|wrap=(optional) If specified, whitespace wrapping will be enabled.. | |||
}}</pre> | }}</pre> | ||
Line 42: | Line 49: | ||
{{ItemIcon/Example|The Red Knight's Final Stratagem|40|true|true}} | {{ItemIcon/Example|The Red Knight's Final Stratagem|40|true|true}} | ||
{{ItemIcon/Example|The Red Knight's Final Stratagem|25|true|true}} | {{ItemIcon/Example|The Red Knight's Final Stratagem|25|true|true}} | ||
{{ItemIcon/ExampleDivider|Other}} | |||
{{ItemIcon/Example|Missing Item Or Item Icon|40|true|true}} | |||
{{ItemIcon/Example|Missing Item Or Item Icon|25|true|true}} | |||
<tr><td>{{ItemIcon|override_icon=Pig's Head Item Icon.png|name=The Joltshooter|override_rarity=legendary|show_name=true|show_rarity=true}}</td><td colspan="3"></td><td><code><nowiki>{{ItemIcon|override_icon=Pig's Head Item Icon.png|name=The Joltshooter|override_rarity=legendary|show_name=true|show_rarity=true}}</nowiki></code></td></tr> | |||
{{ItemIcon/Example|Template:ItemIcon/Item Missing Images|40|true|true}} | |||
<tr><td>{{ItemIcon|name=The Joltshooter|alias=An alias|show_name=true|show_rarity=true}}</td><td colspan="3"></td><td><code><nowiki>{{ItemIcon|name=The Joltshooter|alias=An alias|show_name=true|show_rarity=true}}</nowiki></code></td></tr> | |||
</table> | </table> | ||
=== In-text === | === In-text === | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin tristique ligula vitae turpis varius ullamcorper. Ut sagittis {{ItemIcon|name=Potion of Supreme Healing|size=25|show_rarity=true|show_name=true}} eu dolor accumsan venenatis. Maecenas sit amet ante at ligula efficitur fermentum. Suspendisse ac neque pretium nisi finibus euismod. Suspendisse varius ipsum lorem, vitae consectetur metus mattis sit amet. Proin ornare orci turpis, non blandit lorem scelerisque a. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. {{ItemIcon|name=Titanstring Bow|size=25|show_rarity=true|show_name=true}} in luctus arcu. Proin aliquet lorem quis lacus lacinia molestie. Suspendisse iaculis venenatis nibh, et dapibus augue varius a. | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin tristique ligula vitae turpis varius ullamcorper. Ut sagittis {{ItemIcon|name=Potion of Supreme Healing|size=25|show_rarity=true|show_name=true}} eu dolor accumsan venenatis. Maecenas sit amet ante at ligula efficitur fermentum. Suspendisse ac neque pretium nisi finibus euismod. Suspendisse varius ipsum lorem, vitae consectetur metus mattis sit amet. Proin ornare orci turpis, non blandit lorem scelerisque a. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. {{ItemIcon|name=Titanstring Bow|size=25|show_rarity=true|show_name=true}} in luctus arcu. Proin aliquet lorem quis lacus lacinia molestie. Suspendisse iaculis venenatis nibh, et dapibus augue varius a. | ||
=== Wrap override === | |||
{{ItemIcon|name=A is for Azuth, and other Gods II|nowrap=true|show_name=true}}{{ItemIcon|name=A is for Azuth, and other Gods II|nowrap=true|show_name=true}}{{ItemIcon|name=A is for Azuth, and other Gods II|nowrap=true|show_name=true}}{{ItemIcon|name=A is for Azuth, and other Gods II|nowrap=true|show_name=true}}{{ItemIcon|name=A is for Azuth, and other Gods II|nowrap=true|show_name=true}}{{ItemIcon|name=A is for Azuth, and other Gods II|nowrap=true|show_name=true}}{{ItemIcon|name=A is for Azuth, and other Gods II|nowrap=true|show_name=true}} | |||
=== UID search === | |||
Specifying the {{C|uid}} parameter allows for picking a specific item among a number of different items with the same name. Note that you {{strong|must}} provide the name of the item for it to display properly. | |||
<pre>* {{ItemIcon|name=Leather Armour|show_name=true}} | |||
* {{ItemIcon|name=Leather Armour|uid=ARM_Leather_Rogue|show_name=true}} | |||
* {{ItemIcon|name=Leather Armour|uid=UNI_Leather_Jaheira|show_name=true}}</pre> | |||
* {{ItemIcon|name=Leather Armour|show_name=true}} | |||
* {{ItemIcon|name=Leather Armour|uid=ARM_Leather_Rogue|show_name=true}} | |||
* {{ItemIcon|name=Leather Armour|uid=UNI_Leather_Jaheira|show_name=true}} | |||
== Related templates == | == Related templates == | ||
{{ItemIcon/Family}} | {{ItemIcon/Family}} | ||
== Troubleshooting == | |||
=== Icon does not show up === | |||
* Check that the name is provided correctly. | |||
: Refer to the template you are using. [[Template:ItemIcon]] requires the name to be provided as the <code>name=</code> parameter, while other templates might use anonymous parameters. | |||
* Check that the page exists | |||
: The page must exist and use [[Template:MiscItemPage]], [[Template:EquipmentPage]], [[Template:WeaponPage]], or [[Template:ItemIcon Insert]]. Technically, you could also insert directly into the <code>item_icon</code> Cargo table, but please don't do that without good reason. | |||
: Also make sure that the item is spelled correctly. '''ItemIcon''' is unaware of redirects, which can cause a missing icon link when the page link works fine. | |||
* Check that the parameters are passed to the page-generating templates | |||
: '''ItemIcon''' pulls from the page-generating template parameters, particularly <code>rarity</code>, <code>image</code>, and <code>icon</code>. Either <code>image</code> or <code>icon</code> needs to be set for an icon to show. | |||
* Try doing a null edit on the page. | |||
: The '''ItemIcon''' template was introduced after the page-generating templates. This means that information won't be inserted into the Cargo table until the pages that use the page-generating templates are edited. You can do a '''null edit''' to forcibly insert information into the table. This is an edit where you change nothing. It will not show up in the page's edit history or your contribution page, but it will refresh the page and, if applicable, insert the info needed into the table. | |||
* Ask on Discord | |||
: If none of the above steps work, ask on the Discord and someone might be able to help solve the problem. |