Difference between revisions of "Template:ValuableTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
m (Add Psojed fix for desccription extra space at the end.)
(Fix Fallback version.)
Line 11: Line 11:
     --- Load translations that are used multiple times into variables. ---
     --- Load translations that are used multiple times into variables. ---
     -->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ValuableNames}}}}<!--
     -->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ValuableNames}}}}<!--
     -->{{#vardefine:ItemDescription|{{#if:{{SUBPAGENAME}}|{{:Template:{{uc:{{SUBPAGENAME}}}}_ValuableDescriptions|{{{1}}}}}|{{#var:ItemDescription}}}}}}<!-- Model without fallback
     --- Load translated description or fallback to base description -->
    --- Load translated description or fallback to base description --- Model with fallback (broken)
    {{#vardefine:ItemDescription|{{#if:{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|1|0}}|
    --- {{#vardefine:ItemDescription|{{#ifexist:Template:{{SUBPAGENAME}}_ValuableDescriptions|
        {{#var:ItemDescription}} |
        {{:Template:{{SUBPAGENAME}}_ValuableDescriptions|{{{1}}}}}|
        {{#ifexist:Template:{{uc:{{SUBPAGENAME}}}}_ValuableDescriptions|
        {{#var:ItemDescription}}
            {{:Template:{{SUBPAGENAME}}_ValuableDescriptions|{{{1}}}}} |
     }}}} ---
            {{#var:ItemDescription}}
        }}
     }}}}<!--
     --- Define "Link" var, with a subpage verification. 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. ---
     --- Define "Link" var, with a subpage verification. 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. ---
     -->{{#vardefine:Link|{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}}}
     -->{{#vardefine:Link|{{#ifeq:{{SUBPAGENAME}}|{{PAGENAME}}|{{{1}}}|{{{1}}}/{{SUBPAGENAME}}}}}}

Revision as of 21:27, 23 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.

Debug

For future modifications or debugging, you can add this, after the "ItemDescription" variable (Open Source to verify code):

   [...]
   |{{{1}}}
   Base Image: 
   Variants: 
   Datastring: 

Examples

Single Image

Item Inv. Slots Price Gold Icon Description


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

Multiple Images

Item Inv. Slots Price Gold Icon Description


Horse Pelt 60× Peasants only kill horses that are hopelessly sick or already half-dead from old age. Gold.png Template:1


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