Шаблон:Vendor list result format — различия между версиями

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск
 
 
Строка 1: Строка 1:
{| {{STDT|npc sortable}}
+
<includeonly>|- {{#ifeq: {{#vardefineecho:historical vendor|{{#show:{{{2}}}|?Is historical|default=false}}}} | true
! Vendor {{#vardefine:showSection|{{{showSection|true}}}}}{{#ifeq:{{#var:showSection}}|true|
+
| title="Vendor currently unavailable" class="gray"
!! Section }}
+
| {{#ifeq:{{{6|false}}}|true| title="Item currently unavailable" class="gray" }}
! Location
 
! Cost
 
|-<noinclude>
 
| || ||
 
|}
 
 
 
== Usage ==
 
The table header for vendor inventories. For use with {{tl|vendor list}}.
 
<pre>
 
{{vendor list header
 
| showSection =
 
 
}}
 
}}
</pre>
+
| {{#vardefine:smw_name|{{#show:{{{2|}}}|?Has canonical name}}}} data-sort-value="{{#ifeq: {{#var:historical vendor}} | true | ZZZ }}{{#if: {{#var:smw_name}} | {{#var:smw_name}} | {{{2}}} }}" | {{#if: {{#var:smw_name}} | [[{{{1}}}|{{#var:smw_name}}]] | [[{{{1}}}|{{{2}}}]] }}
 
+
{{#ifeq:{{#var:showSection|false}}|true| {{!}} style="max-width:100px;" {{!}} {{{3}}} }}
== Parameters ==
+
| style="max-width:400px;" | {{#show:{{{2|}}}|?Located in|default=–|sep=;}}
;showSection
+
| style="text-align:{{#if:{{#var:showCostText|}}|left|right}}" | {{#ifeq:{{{5}}}|1|<!--Nothing-->|{{{5}}}&nbsp;/&nbsp;}}{{#arraymap:{{#replace:{{#replace:{{{4}}}|.|}}<!--fix for languages that use dots as thousand separators-->| |}}<!--fix for languages using nbsp as thousand separators -->,|),|@@@|
: Default false. Show the section of the vendor the item is in. Redundant for most tables.
+
{{currency|{{#replace:{{#explode:@@@| }}|,|}}| {{#sub:@@@|{{#expr:2+{{#pos:@@@| }}}}}}| text = {{#if:{{#var:showCostText|}}|+}} }}
 
+
|&nbsp;+&nbsp;}}
 +
</includeonly><noinclude>
 +
This semantic result template is used for formatting results from {{tl|vendor list}} and {{tl|vendor table}}. The following parameters are passed to the template:
 +
#Vendor subobject
 +
#Has vendor
 +
#Has vendor section
 +
#Has item cost
 +
#Has item quantity
 +
#Is historical
  
 
[[Category:Vendor formatting templates]]
 
[[Category:Vendor formatting templates]]
 +
[[Category:Semantic result templates]]
 
</noinclude>
 
</noinclude>

Текущая версия на 13:29, 4 апреля 2018

This semantic result template is used for formatting results from {{vendor list}} and {{vendor table}}. The following parameters are passed to the template:

  1. Vendor subobject
  2. Has vendor
  3. Has vendor section
  4. Has item cost
  5. Has item quantity
  6. Is historical