Difference between revisions of "Template:WeaponTable/row"
Jump to navigation
Jump to search
(updated to load item data from Data page) Tag: Reverted |
|||
Line 1: | Line 1: | ||
<includeonly>{{#vardefine: | <includeonly><!-- | ||
--- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. --- | |||
-->{{#vardefine:Range|{{:Data|{{{1}}}|Range}}}}<!-- | |||
| | -->{{#vardefine:Name|{{:Data|{{{1}}}|Name}}}}<!-- | ||
-->{{#vardefine:Image|{{:Data|{{{1}}}|Image}}}}<!-- | |||
|{{: | -->{{#vardefine:Rarity|{{:Data|{{{1}}}|Rarity}}}}<!-- | ||
| | |||
}}}} | |||
|- | |- | ||
|{{#if:{{:{{{1}}}|Unobtainable}}|{{Unobtainable}}<br />}}'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|{{#if:{{: | |{{#if:{{:Data|{{{1}}}|Unobtainable}}|{{Unobtainable}}<br />}}<!-- | ||
| | --- Check if we are on a subpage. If subpagename = pagename, we are not on a subpage, therefore URL becomes "item name". If we are on a subpage, URL becomes "item name/subgpagename". Used for other languages. --- | ||
-->'''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!-- | |||
--- Check if there is a custom item name. If yes, check if the custom name has a translation. If yes, load translation of custom name. Otherwise, return empty string. Why do we use this again? --- | |||
-->{{#if:{{#var:Name}}|{{#if:{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{#var:Name}}|ItemNames}}}}|<!-- | |||
--- Check if item name has a translation. If yes, load translation of item name. If not, return empty string. Used for other languages. --- | |||
-->{{#if:{{Translate|{{{1}}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}}}]]'''<!-- | |||
--- Check if there is a custom image link. If yes, load custom image from link, otherwise load "item name.png". --- | |||
-->[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{{1}}}.png}}|center|<!-- | |||
--- Check if there is a custom name. If yes, load custom name translation, otherwise load item name translation. --- | |||
-->alt={{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ItemNames}}|{{Translate|{{{1}}}|ItemNames}}}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]] | |||
| {{#if:{{#var:Rarity}}||{{#vardefine:Rarity|Common}}}}{{c|{{#var:Rarity}}|{{Translate|{{#var:Rarity}}|Properties}}}} | |||
| data-sort-value="{{TotalDamage|{{{1}}}}}" | {{Damage|{{{1}}}}} | | data-sort-value="{{TotalDamage|{{{1}}}}}" | {{Damage|{{{1}}}}} | ||
| {{:{{{1}}}|Durability}} | | {{:Data|{{{1}}}|Durability}} | ||
{{#if:{{#var:weapon table ranged}}| | {{#if:{{#var:weapon table ranged}}| | ||
{{!}} {{#var: | {{!}} {{#var:Range}} | ||
}} | }} | ||
| {{:{{{1}}}|Price}} | | {{:Data|{{{1}}}|Price}} | ||
| {{ | | {{Test|{{{1}}}}}</includeonly><noinclude>{{doc}}[[Category:Templates]]</noinclude> |
Revision as of 19:41, 28 May 2022
This template has no documentation. If you know how to use this template, please add some.