Difference between revisions of "Template:ContainerTable"

From Stoneshard wiki
Jump to navigation Jump to search
(Fix Translation Template. I forgot there is no need for the {{SUBPAGENAME}} definition.)
(Fix/Cuts function calls in half - from ~62 explodes to ~31 explodes for a full list.)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>{{stub}}</noinclude><includeonly><!--
<noinclude>{{stub}}</noinclude><includeonly><!--
    --- Define variables, to only load from the Data page once. ---
     --- Pull item list from Container data ---
    --- Loads the parameters from the CONTAINER specified in the first parameter ---
    -->{{#vardefine:ContainerName|{{{1}}}}} <!--
    --- Defines Containers' Category in the second parameter ---
    -->{{#vardefine:Category|{{{2}}}}}<!--
     --- Pull item list from Container data. This access the {{{2}}} param directly. ---
     -->{{#vardefine:ItemList|{{:Container data|{{{1}}}|{{{2}}}}}}}<!--
     -->{{#vardefine:ItemList|{{:Container data|{{{1}}}|{{{2}}}}}}}<!--
     -->{{#vardefine:Index|&#8239;&bull;&#8239;}}<!--
     -->{{#vardefine:Index|&#8239;&bull;&#8239;}}<!--
     --- Load translations that are used multiple times into variables. ---
     --- Translation Table variable, reduced to "TT", but still defines which Translation "table" to use for the ItemNames ---
     -->{{#vardefine:TranslateName|{{Translate|{{{1}}}|ContainerName}}}}<!--
     -->{{#vardefine:TT|{{#ifeq:{{{2}}}|Jewelry|ValuableNames|{{#ifeq:{{{2}}}|Loot|ValuableNames|{{#ifeq:{{{2}}}|Consumables|ConsumableNames|{{#ifeq:{{{2}}}|Treatises|Treatises|ItemNames}}}}}}}}}}<!--
     --- Output ONE table row with two cells -->
     -->|-
    |-
     | style="border: 5px solid #1e1a31;"|[[{{{2}}}]]
     | style="border: 5px solid #1e1a31;"|[[{{{2}}}]]<!-- First Column/Cell & Category -->
     ! colspan="5" style="border: 5px solid #1e1a31; border-collapse: collapse;" |<!--
     ! colspan="5" style="border: 5px solid #1e1a31; border-collapse: collapse;" |<!-- Display items
    --- Reuses one variable i for all items instead of calling #explode twice ---
     -->{{#if:{{#explode:{{#var:ItemList}}|;|0}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|0}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|1}}|{{#var:Index}}| |- }}}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|0}}}}{{#if:{{#var:i}}|'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|1}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|1}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|2}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|1}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|2}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|2}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|3}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|2}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|3}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|3}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|4}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|3}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|4}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|4}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|5}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|4}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|5}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|5}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|6}}|{{#var:Index}}| |- }}}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|5}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|6}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|6}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|7}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|6}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|7}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|7}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|8}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|7}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|8}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|8}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|9}}|{{#var:Index}}| |- }}}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|8}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|9}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|9}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|10}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|9}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|10}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|10}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|11}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|10}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|11}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|11}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|12}}|{{#var:Index}}| |- }}}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|11}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|12}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|12}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|13}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|12}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|13}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|13}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|14}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|13}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|14}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|14}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|15}}|{{#var:Index}}| |- }}}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|14}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|15}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|15}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|16}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|15}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|16}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|16}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|17}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|16}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#if:{{#explode:{{#var:ItemList}}|;|17}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|17}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|18}}|{{#var:Index}}| |- }}}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|17}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#if:{{#explode:{{#var:ItemList}}|;|18}}|'''[[{{Translate|{{#replace:{{#explode:{{#var:ItemList}}|;|18}}|_|&#8239;}}|ItemNames}}]]'''{{#if:{{#explode:{{#var:ItemList}}|;|19}}|{{#var:Index}}| |- }}}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|18}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|19}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|20}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|21}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|22}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|23}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|24}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|25}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
     -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|26}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|27}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|28}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|29}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''}}<!--
    -->{{#vardefine:i|{{#explode:{{#var:ItemList}}|;|30}}}}{{#if:{{#var:i}}|{{#var:Index}}'''[[{{Translate|{{#replace:{{#var:i}}|_|&#8239;}}|{{#var:TT}}}}]]'''| |- }}<!--
--></includeonly><noinclude>{{doc|Template:ContainerTable}}[[Category:Templates]]</noinclude>
--></includeonly><noinclude>{{doc|Template:ContainerTable}}[[Category:Templates]]</noinclude>

Latest revision as of 05:58, 25 October 2025


This article is a stub. You can help Stoneshard wiki by expanding it.

Template-info.png Documentation

WORKING: [IMPLEMENTED]
DO NOT DELETE THESE &#8239; and &bull;.

This Template uses Container data.

Syntax

{{ContainerTable|(ContainerName)|(Category)}}

Usage

The template, must be used with an outer table, like so:

 
{| cellpadding="5" style="text-align: center; margin-left: left; border: 5px solid #1e1a31; background-color: #231f36; width: -webkit-fill-available; width: -moz-fill-available;"
|-
{{ContainerTable|Hero Sarcophagus|Armor}}
{{ContainerTable|Hero Sarcophagus|Weapons}}
{{ContainerTable|Hero Sarcophagus|Jewelry}}
{{ContainerTable|Hero Sarcophagus|Consumables}}
{{ContainerTable|Hero Sarcophagus|Loot}}
{{ContainerTable|Hero Sarcophagus|Treatises}}
|}

If the container has an empty category, you can call it or not, it will only show a blank row.

Example

Example for Hero Sarcophagus

Armor Pig-Faced Bascinet • Arcanist Cowl • Ceremonial Armor • Work Gloves
Weapons Bollock Dagger • Footman Sword • Rondel • Recruit Bastard Sword • Footman Axe • War Pick • Knight Warhammer • Fancy Sword • Ornate Dagger • Orient Staff • Militia Spear
Jewelry Gold Ring • Pearl Necklace • Golden Fancy Ring • Golden Patterned Ring • Sapphire Talisman
Consumables
Loot Emerald • Sapphire • Sea Pearls • Ruby Beads • Exquisite Casket • Golden Earrings • Amethyst • Aquamarine • Topaz • Golden Brooch • Old Agraffe • Silver Buckle • Golden Cup • Diamond • Ruby
Treatises