Jump to content

Template:Infobox Item: Difference between revisions

From Xandaris Wiki
Fix: add namespace check to prevent template page self-categorization
Fix: escape category links in documentation to prevent template self-categorization
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><table class="wikitable" style="float:right; margin-left:1em;"><tr><th colspan="2">{{{name|{{PAGENAME}}}}}</th></tr>{{#if:{{{image|}}}|<tr><td colspan="2" style="text-align:center;">[[File:{{{image}}}|250px]]</td></tr>}}{{#if:{{{type|}}}|<tr><td>'''Type'''</td><td>{{{type}}}</td></tr>}}{{#if:{{{wielder|}}}|<tr><td>'''Wielder'''</td><td>{{{wielder}}}</td></tr>}}{{#if:{{{found_date|}}}|<tr><td>'''Found'''</td><td>{{{found_date}}}</td></tr>}}{{#if:{{{found_by|}}}|<tr><td>'''Found By'''</td><td>{{{found_by}}}</td></tr>}}{{#if:{{{creator|}}}|<tr><td>'''Creator'''</td><td>{{{creator}}}</td></tr>}}{{#if:{{{enchantments|}}}|<tr><td>'''Enchantments'''</td><td>{{{enchantments}}}</td></tr>}}{{#if:{{{kills|}}}|<tr><td>'''Player Kills'''</td><td>{{{kills}}}</td></tr>}}{{#if:{{{kill_list|}}}|<tr><td>'''Kill List'''</td><td>{{{kill_list}}}</td></tr>}}{{#if:{{{mob_kills|}}}|<tr><td>'''Mob Kills'''</td><td>{{{mob_kills}}}</td></tr>}}{{#if:{{{damage_dealt|}}}|<tr><td>'''Damage Dealt'''</td><td>{{{damage_dealt}}}</td></tr>}}{{#if:{{{durability|}}}|<tr><td>'''Durability'''</td><td>{{{durability}}}</td></tr>}}{{#if:{{{location|}}}|<tr><td>'''Location'''</td><td>{{{location}}}</td></tr>}}{{#if:{{{status|}}}|<tr><td>'''Status'''</td><td>{{{status}}}</td></tr>}}</table>{{#ifeq:{{NAMESPACE}}|Template||[[Category:Items]]{{#ifeq:{{lc:{{{type|}}}}}|weapon|[[Category:Weapons]]}}}}</includeonly>
<includeonly><table class="wikitable" style="float:right; margin-left:1em;"><tr><th colspan="2">{{{name|{{PAGENAME}}}}}</th></tr>{{#if:{{{image|}}}|<tr><td colspan="2" style="text-align:center;">[[File:{{{image}}}|250px]]</td></tr>}}{{#if:{{{type|}}}|<tr><td>'''Type'''</td><td>{{{type}}}</td></tr>}}{{#if:{{{wielder|}}}|<tr><td>'''Wielder'''</td><td>{{{wielder}}}</td></tr>}}{{#if:{{{found_date|}}}|<tr><td>'''Found'''</td><td>{{{found_date}}}</td></tr>}}{{#if:{{{found_by|}}}|<tr><td>'''Found By'''</td><td>{{{found_by}}}</td></tr>}}{{#if:{{{creator|}}}|<tr><td>'''Creator'''</td><td>{{{creator}}}</td></tr>}}{{#if:{{{enchantments|}}}|<tr><td>'''Enchantments'''</td><td>{{{enchantments}}}</td></tr>}}{{#if:{{{kills|}}}|<tr><td>'''Player Kills'''</td><td>{{{kills}}}</td></tr>}}{{#if:{{{kill_list|}}}|<tr><td>'''Kill List'''</td><td>{{{kill_list}}}</td></tr>}}{{#if:{{{mob_kills|}}}|<tr><td>'''Mob Kills'''</td><td>{{{mob_kills}}}</td></tr>}}{{#if:{{{damage_dealt|}}}|<tr><td>'''Damage Dealt'''</td><td>{{{damage_dealt}}}</td></tr>}}{{#if:{{{durability|}}}|<tr><td>'''Durability'''</td><td>{{{durability}}}</td></tr>}}{{#if:{{{location|}}}|<tr><td>'''Location'''</td><td>{{{location}}}</td></tr>}}{{#if:{{{status|}}}|<tr><td>'''Status'''</td><td>{{{status}}}</td></tr>}}</table></includeonly>{{#ifeq:{{NAMESPACE}}|Template||[[Category:Items]]{{#ifeq:{{lc:{{{type|}}}}}|weapon|[[Category:Weapons]]}}}}<noinclude>
<noinclude>
== Usage ==
== Usage ==
<pre>
<pre>
Line 23: Line 22:
All fields are optional. <code>name</code> defaults to <code><nowiki>{{PAGENAME}}</nowiki></code>.
All fields are optional. <code>name</code> defaults to <code><nowiki>{{PAGENAME}}</nowiki></code>.


Auto-categorization: all pages get [[Category:Items]]. If <code>type=weapon</code>, also [[Category:Weapons]].
Auto-categorization: all pages get <nowiki>[[Category:Items]]</nowiki>. If <code>type=weapon</code>, also <nowiki>[[Category:Weapons]]</nowiki>.
</noinclude>
</noinclude>

Latest revision as of 02:45, 4 March 2026

Usage[edit]

{{Infobox Item
| name          =
| image         =
| type          = weapon / armor / tool / misc
| wielder       =
| found_date    =
| found_by      =
| creator       =
| enchantments  =
| kills         =
| kill_list     =
| mob_kills     =
| damage_dealt  =
| durability    =
| location      =
| status        =
}}

All fields are optional. name defaults to {{PAGENAME}}.

Auto-categorization: all pages get [[Category:Items]]. If type=weapon, also [[Category:Weapons]].