Difference between revisions of "Template:ValuableTable/row"
Jump to navigation
Jump to search
(Add test to reproduce WeaponTable/row) |
|||
Line 1: | Line 1: | ||
<includeonly><! | <includeonly> | ||
<!-- Load complete datastring into a variable - to only load from the Loot data page once. --> | |||
{{#vardefine:Datastring|{{:Valuable_data|{{{1}}}}}}} | |||
<!-- Separate values from datastring into individual variables. --> | |||
{{#vardefine:ItemName|{{{1}}}}} | |||
{{#vardefine:InvSlots|{{ValuableData|{{#var:ItemName}}|InvSlots}}}} | |||
{{#vardefine:Price|{{ValuableData|{{#var:ItemName}}|Price}}}} | |||
{{#vardefine:ItemDescription|{{ValuableDescriptions|{{#var:ItemName}}}}}} | |||
<!-- Load translations that are used multiple times into variables. --> | |||
{{#vardefine:TranslateName|{{Translate|{{{1}}}|ItemNames}}}} | |||
|- | |- | ||
<!-- 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. -- | <!-- 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 item name has a translation. If yes, load translation of item name. If not, return empty string. Used for other languages. -- | --- Check if item name has a translation. If yes, load translation of item name. If not, return empty string. Used for other languages. --> | ||
{{#if:{{#var:TranslateName}}|{{#var:TranslateName}}}}]]'''<!-- | |||
-->[[File:{{{1}}}.png|center|<!-- | -->[[File:{{{1}}}.png|center|<!-- | ||
--- Check if there is a custom name. If yes, load custom name translation, otherwise load item name translation. -- | --- Check if there is a custom name. If yes, load custom name translation, otherwise load item name translation. --> | ||
alt={{#var:TranslateName}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]] | |||
| {{#var:InvSlots}} | | {{#var:InvSlots}} | ||
| {{#var:Price}} [[File:Gold.png|27x27px]] | | {{#var:Price}} [[File:Gold.png|27x27px]] |
Revision as of 13:19, 14 January 2025
Documentation
[purge]
This article is a stub. You can help Stoneshard wiki by expanding it. |
This Template replicates the logic used for the Template:WeaponTable/row.
Syntax
{{ValuableTable/row|Agate}}
Usage
It should be used with a 'header', right before it.
{{ValuableTable/head}}
{{ValuableTable/row|Agate}}
.
Any Valuables added in Valuable Data, can be used with the '/row' template.
Example
Item | Inv. Slots | Price | Description
|
---|---|---|---|
Agate | Template:ValuableData | Template:ValuableData | Template:ValuableDescriptions
|