Difference between revisions of "Template:Vendor table row"
Jump to navigation
Jump to search
m |
m |
||
Line 14: | Line 14: | ||
| default = {{Vendor table row result format|{{#var:item_page}}|{{#var:item_page}}|File:{{#var:item_page}}.png|{{{class|}}}|{{{type|}}}|{{{rarity|-}}}|{{{level|}}}}} | | default = {{Vendor table row result format|{{#var:item_page}}|{{#var:item_page}}|File:{{#var:item_page}}.png|{{{class|}}}|{{{type|}}}|{{{rarity|-}}}|{{{level|}}}}} | ||
}} | }} | ||
| data-sort-value="{{uc:{{#arraymap: {{{cost|}}} |+|@@@| {{#sub:@@@|{{#pos:@@@| }}}} {{padleft:{{#explode:@@@| |0}}|8}} |}}}}" style="text-align:left;" | {{#arraymap:{{{cost|}}} | + | @@@ | {{currency|{{#explode:@@@| |0}}|{{#sub:@@@|{{#pos:@@@| }}}}|{{#ifeq:{{#sub:@@@|{{#pos:@@@| }}}}|coin|y}}|icon={{{cost icon|}}}|text={{#if:{{#var:showCostText|}}|+}}}} | + | | data-sort-value="{{uc:{{#arraymap: {{{cost|}}} |+|@@@| {{#sub:@@@|{{#pos:@@@| }}}} {{padleft:{{#explode:@@@| |0}}|8}} |}}}}" style="text-align:left;" | {{#arraymap:{{{cost|}}} | + | @@@ | {{currency|{{#explode:@@@| |0}}|{{#sub:@@@|{{#pos:@@@| }}}}|{{#ifeq:{{#sub:@@@|{{#pos:@@@| }}}}|coin|y}}|icon={{{cost icon|}}}|text={{#if:{{#var:showCostText|}}|+}}}} | + }}<!-- | ||
-->{{#if:{{#var:suppress VTR subobjects|}}||{{#subobject:vendor{{#var:vendorcnt}} | -->{{#if:{{#var:suppress VTR subobjects|}}||{{#subobject:vendor{{#var:vendorcnt}} | ||
|Has vendor={{#var:vendor_pagename|{{PAGENAME}}}} | |Has vendor={{#var:vendor_pagename|{{PAGENAME}}}} | ||
Line 21: | Line 21: | ||
|Sells item={{#var:item_page}} | |Sells item={{#var:item_page}} | ||
|Has item quantity={{{quantity|1}}} | |Has item quantity={{{quantity|1}}} | ||
|Has item cost={{#if: {{{cost|}}} | {{#arraymap:{{{cost}}}|+|@@@|{{#explode:@@@| |0}};{{ucfirst:{{#sub:@@@|{{#pos:@@@| }}}}}}|+}} }}|+sep=+ | |Has item cost={{#if: {{{cost|}}} | {{#arraymap:{{{cost}}}|+|@@@|{{#explode:{{#explode:@@@| |0}}|-|0}};{{ucfirst:{{#sub:@@@|{{#pos:@@@| }}}}}}|+}} }}|+sep=+ | ||
|Has unit cost={{#if: {{{cost|}}} | {{#arraymap:{{{cost}}}|+|@@@|{{#expr:{{#explode:@@@| |0}}/{{{quantity|1}}}}};{{ucfirst:{{#sub:@@@|{{#pos:@@@| }}}}}}|+}} }}|+sep=+ | |Has unit cost={{#if: {{{cost|}}} | {{#arraymap:{{{cost}}}|+|@@@|{{#expr:{{#explode:{{#explode:@@@| |0}}|-|0}}/{{{quantity|1}}}}};{{ucfirst:{{#sub:@@@|{{#pos:@@@| }}}}}}|+}} }}|+sep=+ | ||
}}}}{{#if: {{NAMESPACE}} | <!-- outside of mainspace, don't categorize --> | | }}}}{{#if: {{NAMESPACE}} | <!-- outside of mainspace, don't categorize --> | | ||
{{#if: {{{rarity|}}}{{{level|}}}{{{type|}}}{{{id|}}}{{{item|}}} | {{#if: {{{rarity|}}}{{{level|}}}{{{type|}}}{{{id|}}}{{{item|}}} | ||
Line 64: | Line 64: | ||
: Optional. Look up an item by id rather than name. This is required if multiple items have the same name and you need the specific item sold by the vendor. | : Optional. Look up an item by id rather than name. This is required if multiple items have the same name and you need the specific item sold by the vendor. | ||
;cost | ;cost | ||
: Required. The cost of the item. Use a + symbol if the item requires multiple currencies. | : Required. The cost of the item. Use a + symbol if the item requires multiple currencies. Variable quantities are acceptable with <code><min-max></code> form. | ||
;cost icon | ;cost icon | ||
: Optional. Specify this parameter to define a custom currency icon. This parameter must include the file extension. | : Optional. Specify this parameter to define a custom currency icon. This parameter must include the file extension. |
Revision as of 20:39, 24 August 2018
Usage
The table row for items for use in vendor inventory tables. For use with {{vendor table header}}. The template queries for the item supplied by either name or id. If the item exists, the information is displayed. If the item doesn't exist, the item parameters can be supplied manually. Additional formatting is provided by {{Vendor table row result format}}.
{{vendor table row | item = | cost = }} {{vendor table row | item = | id = | type = | level = | rarity = | quantity = | cost = | cost icon = }}
Subobject
The table creates a subobject with the following properties:
- Has vendor
- Sells item
- Has item quantity
- Has item cost
- Has vendor location (pulled from vendor table header)
Parameters
- item
- Required. Name of the item. The id parameter overrides this parameter.
- id
- Optional. Look up an item by id rather than name. This is required if multiple items have the same name and you need the specific item sold by the vendor.
- cost
- Required. The cost of the item. Use a + symbol if the item requires multiple currencies. Variable quantities are acceptable with
<min-max>
form. - cost icon
- Optional. Specify this parameter to define a custom currency icon. This parameter must include the file extension.
- type
- Optional. The item type. Only required if the item type is undefined.
- quantity
- Optional. Quantity of item given by the purchase. Defaults to 1.
- level
- Optional. Level of the item. Only required if the item has more than one possible level or undefined. Defaults to Property:Has level requirement.
- rarity
- Optional. Rarity of the item. Only required if the item has more than one possible rarity or undefined. Defaults to Property:Has item rarity.
- rowclass
- Optional. Add a css class to the row.
Example
{{vendor table header}} {{vendor table row | item = Raisins | cost = 10 gil }} {{vendor table row | item = Elementalist Gear | cost = 30 Watchwork Sprocket + 3000 coin <!-- separate prices composed of multiple currencies with a + sign. --> }} {{vendor table row | id = 39613 <!-- looks up item with matching game id --> | cost = 100 laurel + 5 Glob of Ectoplasm }} {{vendor table row | item = Mystery Tonic (furniture) | quantity = 2 <!-- displays a (2) after the item name. --> | cost = 200 coin }} |}