Difference between revisions of "Template:ValuableTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(Undo revision 69062 by Kaleb (talk))
Tag: Undo
(Fix ItemDescriptions displaying wrong description, because of subdomain. Line breaks in description collumn still needs to be fixed (can't find the template affecting this).)
 
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 Valuable data page once. ---
     -->{{#vardefine:Datastring|{{:Valuable_data|{{{1}}}}}}}<!--
     -->{{#vardefine:Datastring|{{:Valuable_data|{{{1}}}}}}}<!--
     -- Separate values from datastring into individual variables. --
     -- Separate/Alocate values from datastring into individual variables. --
     -->{{#vardefine:ItemID|{{#explode: {{#var:Datastring}}|;|0}}}}<!--
     -->{{#vardefine:ItemID|{{#explode: {{#var:Datastring}}|;|0}}}}<!-- valuable00;
     -->{{#vardefine:Image|{{#explode: {{#var:Datastring}}|;|1}}}}<!--
     -->{{#vardefine:Image|{{#explode: {{#var:Datastring}}|;|1}}}}<!-- (valuable name);
     -->{{#vardefine:InvSlots|{{#explode: {{#var:Datastring}}|;|2}}}}<!--
     -->{{#vardefine:InvSlots|{{#explode: {{#var:Datastring}}|;|2}}}}<!-- 1x1;
     -->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|3}}}}<!--
     -->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|;|3}}}}<!-- 100;
     -->{{#vardefine:ItemDescription|{{#explode: {{#var:Datastring}}|;|4}}}}<!--
     -->{{#vardefine:ItemDescription|{{#explode: {{#var:Datastring}}|;|4}}}}<!-- (valuable description)
     --- Load translations that are used multiple times into variables. ---
     --- Load translations that are used multiple times into variables. ---
     -->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ItemNames}}}}
     -->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ValuableNames}}}}
     <!-- Determine the subdomain and fetch the appropriate description translation template. -->
     |- <!-- Starts a new table row. [Image inside row]-->
    {{#vardefine:ItemDescription|{{#if:{{SUBPAGENAME}}|{{:Template:{{SUBPAGENAME}}_ValuableDescriptions|{{{1}}}}}|{{#var:ItemDescription}}}}}}
     <!-- 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 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 item name has a translation. If yes, load translation of item name. If not, return empty string. Used for other languages. ---
     | '''[[{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}|<!--
     -->{{#if:{{#var:TranslateName}}|{{#var:TranslateName}}}}]]'''<!--
     --- 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. -->

Latest revision as of 20:06, 15 January 2025

Template-info.png Documentation

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.

Examples

Single Image

Item Inv. Slots Price Gold Icon Description


Agate
Agate
1×1 50 Gold.png Common folk believe agate to bring good luck. It's often used to make cheap jewelry.


Multiple Images

Item Inv. Slots Price Gold Icon Description


Horse Pelt × Gold.png Template:1


Rabbit Pelt 1×2 40-50 Gold.png Despite how cautious and skittish rabbits can be, hunting one down isn't that hard. Their pelts are usually used to make clothes.