Difference between revisions of "Template:ValuableTable/row"
Jump to navigation
Jump to search
Tag: Undo |
|||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly><!-- | ||
<!-- Load complete datastring into a variable - to only load from the Loot data page once. --> | --- Load complete datastring into a variable - to only load from the Loot data page once. --- | ||
{{#vardefine:Datastring|{{:Valuable_data|{{{1}}}}}}} | -->{{#vardefine:Datastring|{{:Valuable_data|{{{1}}}}}}}<!-- | ||
<!-- Separate values from datastring into individual variables. --> | -- Separate values from datastring into individual variables. -- | ||
{{#vardefine: | -->{{#vardefine:ItemID|{{#explode: {{#var:Datastring}}|;|0}}}}<!-- | ||
{{#vardefine:InvSlots|{{ | -->{{#vardefine:Image|{{#explode: {{#var:Datastring}}|;|1}}}}<!-- | ||
{{#vardefine:Price|{{ | -->{{#vardefine:InvSlots|{{#explode: {{#var:Datastring}}|;|2}}}}<!-- | ||
{{#vardefine:ItemDescription|{{ | -->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|3}}}}<!-- | ||
<!-- Load translations that are used multiple times into variables. --> | -->{{#vardefine:ItemDescription|{{#explode: {{#var:Datastring}}|;|4}}}}<!-- | ||
{{#vardefine:TranslateName|{{Translate|{{{1}}}|ItemNames}}}} | --- 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. --> | <!-- Determine the subdomain and fetch the appropriate description translation template. --> | ||
| '''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!-- | {{#vardefine:ItemDescription|{{#if:{{SUBPAGENAME}}|{{:Template:{{SUBPAGENAME}}_ValuableDescriptions|{{{1}}}}}|{{#var:ItemDescription}}}}}} | ||
--- 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}}}}]]'''<!-- | <!-- 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. --> | ||
-->[[File:{{{1}}}.png|center|<!-- | | '''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!-- | ||
--- Check if there is a custom name. If yes, load custom name translation, otherwise load item name translation. --> | --- Check if item name has a translation. If yes, load translation of item name. If not, return empty string. Used for other languages. --> | ||
alt={{#var:TranslateName}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]] | {{#if:{{#var:TranslateName}}|{{#var:TranslateName}}}}]]'''<!-- | ||
| {{#var:InvSlots}} | -->[[File:{{{1}}}.png|center|<!-- | ||
| {{#var:Price}} [[File:Gold.png|27x27px]] | --- Check if there is a custom name. If yes, load custom name translation, otherwise load item name translation. --> | ||
| {{#if:{{#var:ItemDescription}}|{{#var:ItemDescription}}|{{ | alt={{#var:TranslateName}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}]] | ||
| {{slots|{{#explode: {{#var:InvSlots}}|x|0}}|{{#explode: {{#var:InvSlots}}|x|1}}}} | |||
| {{#var:Price}} [[File:Gold.png|27x27px]] | |||
| {{#if:{{#var:ItemDescription}}|{{#var:ItemDescription}}|{{1}}}} | |||
</includeonly> | </includeonly> | ||
<noinclude>{{doc}}[[Category:Templates]]</noinclude> | <noinclude>{{doc}}[[Category:Templates]]</noinclude> |
Latest revision as of 03:08, 15 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 | 1×1 | 50 | Template:Row ValuableDescriptions
|