Difference between revisions of "Template:Weapon"

From Stoneshard wiki
Jump to navigation Jump to search
old>Realpsojed
(automatic category - add check for translation pages. Now Templar Sword gets Category: Sword, Templar Sword/Tooltip gets Category: Sword Tooltips, Templar Sword/cz gets Category: CZ Sword and Templar Sword/cz/Tooltip gets Category: CZ Sword Tooltips)
old>Realpsojed
m (fix)
Line 45: Line 45:
|style="text-align:center;"|[[File:{{ROOTPAGENAME}}.png|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{Translate|{{ROOTPAGENAME}}|ItemNames}}|{{Translate|{{ROOTPAGENAME}}|ItemNames}}]]
|style="text-align:center;"|[[File:{{ROOTPAGENAME}}.png|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{Translate|{{ROOTPAGENAME}}|ItemNames}}|{{Translate|{{ROOTPAGENAME}}|ItemNames}}]]
|}
|}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip |[[Category:{{:{{ROOTPAGENAME}}|WeaponType}} Tooltips]]|{{#if: {{#titleparts: {{PAGENAME}} | 1 | 3}}|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{:{{ROOTPAGENAME}}|WeaponType}} Tooltips]]}}|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{:{{ROOTPAGENAME}}|WeaponType}}]]}}}}|[[Category:{{:{{ROOTPAGENAME}}|WeaponType}}]]}}</includeonly><noinclude>{{doc}}
{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip |[[Category:{{:{{ROOTPAGENAME}}|WeaponType}} Tooltips]]|{{#if: {{#titleparts: {{PAGENAME}} | 1 | 3}}|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{:{{ROOTPAGENAME}}|WeaponType}} Tooltips]]|[[Category: {{uc:{{#titleparts: {{PAGENAME}} | 1 | 2}}}} {{:{{ROOTPAGENAME}}|WeaponType}}]]}}}}|[[Category:{{:{{ROOTPAGENAME}}|WeaponType}}]]}}</includeonly><noinclude>{{doc}}
[[Category:Tooltip templates]]</noinclude>
[[Category:Tooltip templates]]</noinclude>

Revision as of 13:59, 23 June 2021

Template-info.png Documentation

This is weapon template created for use together with the Template:Tooltip hover box template to display tooltip with item attributes for weapons.

Usage: Copy this code to any page where you want to display the item tooltip:

{{{{{1|Tooltip hover box}}}|title={{Weapon}}}}

You can provide the item name as first parameter, otherwise the pagename is used.

By default, the page is also labelled with a category corresponding to the item type (ie. Heavy Aldorian Bow will receive the Category: Bow). If you don't want to add this category to a page, add the category parameter:

{{{{{1|Tooltip hover box}}}|title={{Weapon|Heavy Aldorian Bow|category=no}}}}

Examples: