Difference between revisions of "Template:CommoditiesRatioTable/row"

From Stoneshard wiki
Jump to navigation Jump to search
(Add base Template. Ratios display needs fix. I believe it's something to do with the dots, in the ratios strings.)
 
m (Ratios display fixed, adding #trim.)
Line 1: Line 1:
<noinclude>'''{{c|-|NOT WORKING: [INCOMPLETE]}}'''<br>The {{c|+|&#8239}}; Represents a space " ", to not break the reference for the items. {{c|-|DO NOT DELETE}}.</noinclude>
<noinclude>'''{{c|+|WORKING: [INCOMPLETE]}}'''<br>The '''#trim''' prevents the '''#if''' , from detecting empty data as "false". '''{{c|-|DO NOT DELETE}}'''.</noinclude>
<includeonly><!--  {{NPCLootTable/row|Jurg|Sell|Weapons}} ---
<includeonly><!--  {{NPCLootTable/row|Jurg|Sell|Weapons}} ---
     --- Define variables, goal is to only load each property from the Data page once. ---
     --- Define variables, goal is to only load each property from the Data page once. ---
Line 13: Line 13:
     <!-- Display Location Block (Possible to gather Location in a single block?) -->
     <!-- Display Location Block (Possible to gather Location in a single block?) -->
     | {{{1}}} <!-- Location -->
     | {{{1}}} <!-- Location -->
     | <!--
     | {{#if:{{#var:NPC}}|[[File:{{#var:NPC}}.png|64px]]|No image found for [[{{#var:NPC}}]].}}<br>'''[[{{#var:NPC}}]]'''<!-- Display NPC Icon ---
    --- NPCData gathers all Ratios for said NPC: Display NPC Icon ---
     --- Second column: Ratios List -->
    -->{{#if:{{#var:NPC}}|[[File:{{#var:NPC}}.png|64px]]|No image found for [[{{#var:NPC}}]].}}<br>'''[[{{#var:NPC}}]]'''<!--
    | '''{{#if:{{#trim:{{#explode:{{#var:RatiosList}}|;|0}}}}|{{#explode:{{#var:RatiosList}}|;|0}}|No data}}'''
     --><br>Test RatiosList = {{#var:RatiosList}}<!--
    | '''{{#if:{{#trim:{{#explode:{{#var:RatiosList}}|;|1}}}}|{{#explode:{{#var:RatiosList}}|;|1}}|No data}}'''
    --{{#ifeq:{{#var:Action}}|Sells|
     | '''{{#if:{{#trim:{{#explode:{{#var:RatiosList}}|;|2}}}}|{{#explode:{{#var:RatiosList}}|;|2}}|No data}}'''
        <-- Action is "Sells": Display Category Icons --
     | '''{{#if:{{#trim:{{#explode:{{#var:RatiosList}}|;|3}}}}|{{#explode:{{#var:RatiosList}}|;|3}}|No data}}'''
        '''{{{3}}}'''<br>{{#if:{{#var:Category}}|[[File:{{#var:Category}}_icon.png|64px]]}}!--
     | '''{{#if:{{#trim:{{#explode:{{#var:RatiosList}}|;|4}}}}|{{#explode:{{#var:RatiosList}}|;|4}}|No data}}'''
    --}}
     | '''{{#if:{{#trim:{{#explode:{{#var:RatiosList}}|;|5}}}}|{{#explode:{{#var:RatiosList}}|;|5}}|No data}}'''
    !-- Second column: Ratios List -->
     | '''{{#if:{{#trim:{{#explode:{{#var:RatiosList}}|;|6}}}}|{{#explode:{{#var:RatiosList}}|;|6}}|No data}}'''</includeonly><!--
     |'''{{#if:{{#explode:{{#var:RatiosList}}|;|0|No Commodities found.}}}}'''
--><noinclude>{{doc|Template:NPCLootTable/row}}[[Category:Templates]]</noinclude>
     | {{#if:{{#explode:{{#var:RatiosList}}|;|1|No Commodities found.}}}}
    | {{#if:{{#explode:{{#var:RatiosList}}|;|2|No Commodities found.}}}}
     | {{#if:{{#explode:{{#var:RatiosList}}|;|3|No Commodities found.}}}}
    | {{#if:{{#explode:{{#var:RatiosList}}|;|4|No Commodities found.}}}}
     | {{#if:{{#explode:{{#var:RatiosList}}|;|5|No Commodities found.}}}}
     | {{#if:{{#explode:{{#var:RatiosList}}|;|6|No Commodities found.}}}}<!--
--></includeonly><noinclude>{{doc|Template:NPCLootTable/row}}[[Category:Templates]]</noinclude>

Revision as of 07:58, 30 January 2025

WORKING: [INCOMPLETE]
The #trim prevents the #if , from detecting empty data as "false". DO NOT DELETE.

Template-info.png Documentation

Usage

{{CommoditiesRatioTable/head}}*
{{CommoditiesRatioTable/row|Osbrook|Brukk}}

  • head can use -> |town=Osbrook

Examples

Previous usage

Osbrook NPCs Ratios
NPCs Sacks of Grain Crates of Charcoal Sacks of Salt Shipment of Timber Barrel of Beer Crates of Wine Pails of Cider


Osbrook Brukk.png
Brukk
' ' 1.32 ' 1.21 1.26 1.21


Osbrook Bert.png
Bert
' 1.16 1.32 1.16 ' 1.21 1.21


Osbrook Jurg.png
Jurg
' ' ' 1.26 ' ' '


Osbrook Jebar.png
Jebar
' 1.26 ' ' ' ' '

New implementation

The new implementation used in Commodities, do not define 'town' and uses the <tabber> parser tag, in the page itself, instead of the template.
More information on the <tabber> parser tag, can be found in the Community Portal, under "Tabs".

NPCs Sacks of Grain Crates of Charcoal Sacks of Salt Shipment of Timber Barrel of Beer Crates of Wine Pails of Cider


Osbrook Brukk.png
Brukk
' ' 1.32 ' 1.21 1.26 1.21


Osbrook Bert.png
Bert
' 1.16 1.32 1.16 ' 1.21 1.21