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

Материал из Guild Wars 2 wiki
Перейти к: навигация, поиск
(Новая страница: «{| {{STDT|npc}} ! Item {{#arraymap:showType,showRarity,showLevel,showFacts | , | @@@ | <!-- Define column headers inline --> {{#vardefine:@@@| {{#ifeq:{{{@@@|true}...»)
 
Строка 1: Строка 1:
{| {{STDT|npc}}
+
{{#if: {{{requirement|}}} | <nowiki/>
! Item {{#arraymap:showType,showRarity,showLevel,showFacts | , | @@@ | <!-- Define column headers inline -->
+
* {{vendor table notes|header=true|requirement={{#vardefineecho:vendor requirement|{{{requirement}}}}}}} | {{#vardefine:vendor requirement|}}
   {{#vardefine:@@@| {{#ifeq:{{{@@@|true}}}|false|false|true}} }}       <!-- Define column header variables -->
+
}}<nowiki/>
   {{#ifeq: {{#var:@@@}} | true | !! {{#replace:@@@|show|}} }}         <!-- Variable names match header names -->
+
{| {{STDT|npc sortable {{{class|}}} }} style="display: table" {{#vardefine:vendor historical status|{{#show:{{#titleparts:{{PAGENAME}}}}|?Is historical|default=false}}}} {{#vardefine:vendor availability status|{{#show:{{#titleparts:{{PAGENAME}}}}|?Has availability|default=Current}}}} {{#vardefine:vendor_section|{{{section|General}}}}} {{#ifeq: {{{no subobjects|false}}} |true| {{#vardefine:suppress VTR subobjects|+}} | {{#ifeq: {{#var:suppress VTR subobjects}} |Template:Inventory - no subobjects| {{#vardefine:suppress VTR subobjects|+}} | {{#vardefine:suppress VTR subobjects|}} }} }} {{#vardefine:vendor location|{{{location|{{#show: {{PAGENAME}}|?Located in|valuesep=;|link=none|default=|limit=250|searchlabel=}}}}}}}
|}}
+
! {{#if:{{{itemWidth|}}}  |style="min-width:{{{itemWidth}}}"  }} {{!}} Item     {{#vardefine:showType   |{{{showType|true}}}  }}{{#ifeq: {{#var:showType}}  |true|
! Cost<noinclude>
+
!! {{#if:{{{typeWidth|}}}  |style="min-width:{{{typeWidth}}}"  }} {{!}} Type}}   {{#vardefine:showRarity  |{{{showRarity|true}}} }}{{#ifeq: {{#var:showRarity}}|true|
 +
!! {{#if:{{{rarityWidth|}}}|style="min-width:{{{rarityWidth}}}"}} {{!}} Rarity}} {{#vardefine:showLevel  |{{{showLevel|true}}} }}{{#ifeq: {{#var:showLevel}} |true|
 +
!! {{#if:{{{levelWidth|}}} |style="min-width:{{{levelWidth}}}" }} {{!}} Level}}  {{#vardefine:showPrefix  |{{{showPrefix|false}}}}}{{#ifeq: {{#var:showPrefix}}|true|
 +
!! {{#if:{{{prefixWidth|}}}|style="min-width:{{{prefixWidth}}}"}} {{!}} Prefix}} {{#vardefine:showFacts   |{{{showFacts|true}}}  }}{{#ifeq: {{#var:showFacts}} |true|
 +
!! {{#if:{{{factsWidth|}}} |style="min-width:{{{factsWidth}}}" }} {{!}} Facts}}  {{#vardefine:showCostText|{{#ifeq:{{{showCostText|false}}}|true|+}}}}
 +
!! {{#if:{{{costWidth|}}}  |style="min-width:{{{costWidth}}}"  }} {{!}} Cost    {{#vardefine:showTP      |{{{showTP|false}}}    }}{{#ifeq: {{#var:showTP}}    |true|
 +
!! {{#if:{{{TPWidth|}}}    |style="min-width:{{{TPWidth}}}"    }} data-sort-type="number" {{!}} TP price}}{{#vardefine:showNotes|{{{showNotes|false}}}}}{{#ifeq: {{#var:showNotes}}|true|
 +
!! {{#if:{{{notesWidth|}}} |style="min-width:{{{notesWidth}}}" }} {{!}} Notes}}<noinclude>
 +
|-
 +
| || || || || ||
 
|}
 
|}
  
Строка 11: Строка 20:
 
<pre>
 
<pre>
 
{{vendor table header
 
{{vendor table header
 +
| section =
 
| showType =
 
| showType =
 
| showRarity =
 
| showRarity =
 
| showLevel =
 
| showLevel =
 
| showFacts =
 
| showFacts =
 +
| showTP =
 
}}
 
}}
 
</pre>
 
</pre>
  
 
== Parameters ==
 
== Parameters ==
 +
;section
 +
: Optional. The name of the section (tab) the vendor item is located in.
 +
;location
 +
: Optional. The locations the vendor is located in, separated by ";". Defaults to locations set in the NPC infobox. New NPCs may require a [https://meta.wikimedia.org/wiki/Help:Dummy_edit#Null_edit null edit] to set this property correctly.
 
;showType
 
;showType
 
: Default true. Show the type of item. This can be item type or any item subtypes such as armor type.
 
: Default true. Show the type of item. This can be item type or any item subtypes such as armor type.
 
;showRarity
 
;showRarity
: Default true. Show the [[rarity]] of the item.
+
: Default true. Show the [[Item#Rarity|rarity]] of the item.
 
;showLevel
 
;showLevel
 
: Default true. Show the required level to equip or use the item.
 
: Default true. Show the required level to equip or use the item.
 +
;showPrefix
 +
: Default false. Show the prefix of the item, in plaintext.
 
;showFacts
 
;showFacts
 
: Default true. Show the item facts of the item, this is usually any attribute bonuses or other effects.
 
: Default true. Show the item facts of the item, this is usually any attribute bonuses or other effects.
 +
;showTP
 +
: Default false. Show the TP Price.
 +
;showCostText
 +
: Default false. Show the text description for item prices given with irregular currencies.
 +
;showNotes
 +
: Default false. If enabled it shows the requirements to purchase an item in an extra column (use if several items have an requirement), otherwise the requirements will be shown below the item.
 +
;no subobjects
 +
: Default false. If set to true this parameter will prevent subobjects from {{tl|Vendor table row}} being stored for the current vendor table.
 +
;requirement
 +
: Optional. Set to display the given requirement above the table. Will also add the requirement to each item in the table.
 +
;class
 +
: Optional. Additional CSS classes to pass to the underlying [[Template:STDT]]. Note this is ''in addition'' to the default "npc sortable" classes. Useful if you want, for instance, collapsible or expandable tables.
  
== Other ==
+
[[Category:Vendor formatting templates]]
<nowiki>{{</nowiki>[[Template:Inventory/Table Header|Inventory/Table Header]]<nowiki>}}</nowiki>
 
<nowiki>{{</nowiki>[[Template:Inventory/Item|Inventory/Item]]| item 1 <nowiki>}}</nowiki>
 
<nowiki>{{</nowiki>[[Template:Inventory/Armor|Inventory/Armor]]| item 2 <nowiki>}}</nowiki>
 
<nowiki>{{</nowiki>[[Template:Inventory/Weapon|Inventory/Weapon]]| item 3 <nowiki>}}</nowiki>
 
<nowiki>{{</nowiki>[[Template:Inventory/Accessory|Inventory/Accessory]]| item 4 <nowiki>}}</nowiki>
 
<nowiki>{{</nowiki>[[Template:Inventory/Recipe|Inventory/Recipe]]| item 5 <nowiki>}}</nowiki>
 
 
 
[[Category:Table formatting templates]]
 
 
</noinclude>
 
</noinclude>

Версия 17:57, 31 марта 2023

Item Type Rarity Level Facts Cost

Usage

The table header for vendor inventories. For use with {{vendor table row}}.

{{vendor table header
| section = 
| showType =
| showRarity =
| showLevel =
| showFacts =
| showTP =
}}

Parameters

section
Optional. The name of the section (tab) the vendor item is located in.
location
Optional. The locations the vendor is located in, separated by ";". Defaults to locations set in the NPC infobox. New NPCs may require a null edit to set this property correctly.
showType
Default true. Show the type of item. This can be item type or any item subtypes such as armor type.
showRarity
Default true. Show the rarity of the item.
showLevel
Default true. Show the required level to equip or use the item.
showPrefix
Default false. Show the prefix of the item, in plaintext.
showFacts
Default true. Show the item facts of the item, this is usually any attribute bonuses or other effects.
showTP
Default false. Show the TP Price.
showCostText
Default false. Show the text description for item prices given with irregular currencies.
showNotes
Default false. If enabled it shows the requirements to purchase an item in an extra column (use if several items have an requirement), otherwise the requirements will be shown below the item.
no subobjects
Default false. If set to true this parameter will prevent subobjects from {{Vendor table row}} being stored for the current vendor table.
requirement
Optional. Set to display the given requirement above the table. Will also add the requirement to each item in the table.
class
Optional. Additional CSS classes to pass to the underlying Template:STDT. Note this is in addition to the default "npc sortable" classes. Useful if you want, for instance, collapsible or expandable tables.