Difference between revisions of "Template:Consumable test"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. --- | --- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. --- | ||
-->{{#vardefine:Name|{{:Consumable_data|{{ | -->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!-- | ||
-->{{#vardefine:PropertyText|{{:Consumable_data|{{ | -->{{#vardefine:SubPage|{{#if:{{SUBPAGENAME}}|{{SUBPAGENAME}}|{{#var:Page}}}}}}<!-- | ||
-->{{#vardefine:Freshness|{{:Consumable_data|{{ | -->{{#vardefine:BasePage|{{#if:{{BASEPAGENAME}}|{{BASEPAGENAME}}|{{#var:Page}}}}}}<!-- | ||
-->{{#vardefine:Uses|{{:Consumable_data|{{ | -->{{#vardefine:OtherPage|{{#if:{{PAGENAME}}|{{PAGENAME}}|{{#var:Page}}}}}}<!-- | ||
-->{{#vardefine:Durability|{{:Consumable_data|{{ | -->{{#vardefine:Name|{{:Consumable_data|{{#var:Page}}|Name}}}}<!-- | ||
-->{{#vardefine:Description|{{:Consumable_data|{{ | -->{{#vardefine:PropertyText|{{:Consumable_data|{{#var:Page}}|PropertyText}}}}<!-- | ||
-->{{#vardefine:Price|{{:Consumable_data|{{ | -->{{#vardefine:Freshness|{{:Consumable_data|{{#var:Page}}|Freshness}}}}<!-- | ||
-->{{#vardefine:Image|{{:Consumable_data|{{ | -->{{#vardefine:Uses|{{:Consumable_data|{{#var:Page}}|Uses}}}}<!-- | ||
-->{{#vardefine:Image2|{{:Consumable_data|{{ | -->{{#vardefine:Durability|{{:Consumable_data|{{#var:Page}}|Durability}}}}<!-- | ||
-->{{#vardefine:Description|{{:Consumable_data|{{#var:Page}}|Description}}}}<!-- | |||
-->{{#vardefine:Price|{{:Consumable_data|{{#var:Page}}|Price}}}}<!-- | |||
-->{{#vardefine:Image|{{:Consumable_data|{{#var:Page}}|Image}}}}<!-- | |||
-->{{#vardefine:Image2|{{:Consumable_data|{{#var:Page}}|Image2}}}}<!-- | |||
--- Consumable Tooltip start. --- | --- Consumable Tooltip start. --- | ||
-->{| width=300px; | -->{| width=300px; | ||
|style="text-align:center;"|<!-- | |style="text-align:center;"|<!-- | ||
--- Check if item is marked as unobtainable. --- | --- Check if item is marked as unobtainable. --- | ||
-->{{#if:{{:Consumable data|{{ | -->{{#if:{{:Consumable data|{{#var:Page}}|Unobtainable}}|{{Unobtainable}}<br />|}}<!-- | ||
--- Check if parameter Name exists, if yes, use that parameter value as Name, otherwise use | --- Check if parameter Name exists, if yes, use that parameter value as Name, otherwise use #var:Page. For items with name identical to another (Dirk item vs Dirk NPC). --- | ||
--><span style="font-size: 20px;">{{Translate|{{#if:{{#var:Name}}|{{#var:Name}}|{{ | --><span style="font-size: 20px;">{{Translate|{{#if:{{#var:Name}}|{{#var:Name}}|{{#var:Page}}}}|ConsumableNames}}</span><br /><!-- | ||
--><span style="color:#9d9a9a;">{{Translate|{{:Consumable data|{{ | --><span style="color:#9d9a9a;">{{Translate|{{:Consumable data|{{#var:Page}}|ItemType}}|Properties}}</span><!-- | ||
--- Check if item has no Properties at all, if yes, then don't add a horizontal rule, otherwise add it. --- | --- Check if item has no Properties at all, if yes, then don't add a horizontal rule, otherwise add it. --- | ||
-->{{#if: {{:Consumable data|{{ | -->{{#if: {{:Consumable data|{{#var:Page}}|NoProperties}}||{{Tooltip rule}}}} | ||
|- | |- | ||
|<div style="width:100%;color:white;">{{Test|{{ | |<div style="width:100%;color:white;">{{Test|{{#var:Page}}}}<!-- | ||
-->{{#if: {{#var:PropertyText}} | <div>{{#if: {{#titleparts: {{ | -->{{#if: {{#var:PropertyText}} | <div>{{#if: {{#titleparts: {{#var:OtherPage}} | 1 | 2}} | {{#ifeq: {{#var:OtherPage}} | {{#var:Page}}/Tooltip | {{#var:PropertyText}} | {{Translate|{{#var:Page}}|ConsumableDescriptions}}}} | {{#var:PropertyText}}}}</div>{{#if: {{#var:Freshness}}|<br>}}|}}</div><!-- | ||
-->{{#if: {{#var:Freshness}} | {{#ifeq: {{#var:Freshness}}|0|<div><span style="color:white;">Does not spoil over time.</span></div>{{#if: {{#var:Uses}}|<br>}}|<div style="color:#9d9a9a;">{{Translate|Will spoil in|Properties}} <span style="color:white;">{{#iferror: {{#expr: ceil({{#var:Freshness}}/24) }}|error}} {{#iferror: {{#ifexpr: {{#var:Freshness}} > 24 |days|day}}|error}}.</span></div>}}}}<!-- | -->{{#if: {{#var:Freshness}} | {{#ifeq: {{#var:Freshness}}|0|<div><span style="color:white;">Does not spoil over time.</span></div>{{#if: {{#var:Uses}}|<br>}}|<div style="color:#9d9a9a;">{{Translate|Will spoil in|Properties}} <span style="color:white;">{{#iferror: {{#expr: ceil({{#var:Freshness}}/24) }}|error}} {{#iferror: {{#ifexpr: {{#var:Freshness}} > 24 |days|day}}|error}}.</span></div>}}}}<!-- | ||
-->{{#if: {{#switch:{{#var:Uses}}|0|1=|{{#var:Uses}}}} |<div style="color:#9d9a9a;">{{Translate|Uses|Properties}}: <span style="color:white;">{{#var:Uses}}/{{#var:Uses}}</span></div>{{#if: {{#var:Durability}}|<br>}}| }}<!-- | -->{{#if: {{#switch:{{#var:Uses}}|0|1=|{{#var:Uses}}}} |<div style="color:#9d9a9a;">{{Translate|Uses|Properties}}: <span style="color:white;">{{#var:Uses}}/{{#var:Uses}}</span></div>{{#if: {{#var:Durability}}|<br>}}| }}<!-- | ||
-->{{#if: {{#var:Durability}} |<div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div> | }} | -->{{#if: {{#var:Durability}} |<div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div> | }} | ||
|- | |- | ||
|style="color:#9d7969;"|{{Tooltip rule}}{{#if: {{#titleparts: {{ | |style="color:#9d7969;"|{{Tooltip rule}}{{#if: {{#titleparts: {{#var:OtherPage}} | 1 | 2}} | {{#ifeq: {{#var:OtherPage}} | {{#var:Page}}/Tooltip | {{#var:Description}} | {{Translate|{{#var:Page}}|ConsumableDescriptions}}}} | {{#var:Description}}}}{{#if:{{#var:Price}}|<div style="float:right">[[File:Gold_Icon.png|18px|alt={{Translate|Price|Properties}}|link=|{{Translate|Price|Properties}}]]{{W|{{#var:Price}}}}</div>}} <br /> | ||
|- | |- | ||
|style="text-align:center;"|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{ | |style="text-align:center;"|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{#var:Page}}.png}}|class=image2x|link={{#ifeq:{{#var:SubPage}}|Tooltip|{{#var:BasePage}}|{{#var:OtherPage}}/Tooltip}}|alt={{Translate|{{#var:Page}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}]]{{#if:{{#var:Image2}}|[[File:{{#var:Image2}}|class=image2x|link={{#ifeq:{{#var:SubPage}}|Tooltip|{{#var:BasePage}}|{{#var:OtherPage}}/Tooltip}}|alt={{Translate|{{#var:Page}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}]]}} | ||
|} | |} | ||
</includeonly><noinclude>{{doc}} | </includeonly><noinclude>{{doc}} | ||
[[Category:Tooltip templates]]</noinclude> | [[Category:Tooltip templates]]</noinclude> |
Latest revision as of 16:38, 27 July 2022
This template has no documentation. If you know how to use this template, please add some.