Template:Shop/doc: Difference between revisions

From Dragon Quest Wiki
Jump to navigation Jump to search
updated for added functionality
updated for latest changes
Line 2: Line 2:


==Usage==
==Usage==
In almost all cases, using this template should be preceded by a heading describing the shop type on the article it is being transcluded onto (i.e.<nowiki>==Item Shop==</nowiki>).  This is because there is no label marking the table as a specific type of shop within this template.  This is consistent with other location templates.
In almost all cases, using this template should be preceded by a heading describing the shop type on the article it is being transcluded onto (i.e.<nowiki>==Item Shops==</nowiki>).  This is because there is no label marking the table as a specific type of shop within this template.  This is consistent with other location templates.
===Header===
===Header===
A header call to this template should be the first usage of this template on any page.
A header call to this template should be the first usage of this template on any page.
<pre>{{Shop|header}}</pre>
<pre>{{Shop|header|includeClasses|collapsed|title=[[Dragon Quest II]]|subtitle=NES}}</pre>
*header: A required parameter which marks this as the start of a shop table.
*header: A required parameter which marks this as the start of a shop table.
===Subtable===
*includeClasses: An optional parameter marking whether this subtable should include a column for character classesThis applies when the shop has equipment which can be equipped by 1 or more characters. It should be used in association with entries that include the 'classes' parameter (see below).
A subtable call is made to designate shop data for a specific game and consoleNote that for shops which sell the same items across different versions of a game should be merged into one subtable (i.e. console=NES,GBC). Due to width constraints, a single Shop set '''should not include more than 4 subtable sections''' and should be broken up into separate sets.  Otherwise, the page will be difficult to view.
*collapsed: An optional parameter marking whether this table should be collapsed by default.  Omitting it leaves the table uncollapsed.
<pre>{{Shop|subtable|game=[[Dragon Quest II]]|console=NES}}</pre>
*subtable: A required parameter marking the start of a subtable.
*title: The title to be used for this subtable.  Most often this is the game this shop represents.  Should be an interwiki link when applicable.
*title: The title to be used for this subtable.  Most often this is the game this shop represents.  Should be an interwiki link when applicable.
*subtitle: An optional parameter.  The subtitle to be used for this subtable.  Often the console version of the game. '''Note:''' This parameter should contain multiple console values separated by commas if the game and price parameters are the same!
*subtitle: An optional parameter.  The subtitle to be used for this subtable.  Often the console version of the game.  
*includeClasses: An optional parameter marking whether this subtable should include a column for character classes.  This applies when the shop has equipment which can be equipped by 1 or more characters.  It should be used in association with entries that include the 'classes' parameter (see below).
===Entries===
===Entries===
Each entry in the shop table is represented by a single template call. Note that the list of entries for a shop should follow the ordering of the list in-game.  Also, the names of items should also be the ones used in-game, meaning they will often be redirect links.
Each entry in the shop table is represented by a single template call. Note that the list of entries for a shop should follow the ordering of the list in-game.  Also, the names of items should also be the ones used in-game, meaning they will often be redirect links.
Line 22: Line 19:
*attributes: Attributes describing the item.
*attributes: Attributes describing the item.
*classes: Inter-wiki links to classes/characters that can equip this item. This field should only be used in subtables marked with 'includeClasses'.
*classes: Inter-wiki links to classes/characters that can equip this item. This field should only be used in subtables marked with 'includeClasses'.
===Subtable Footer===
This call is mainly for formatting purposes separate sets of shop data.
<pre>{{Shop|subtablefooter}}</pre>
*subtablefooter: A required parameter marking the end of a subtable.
===Footer===
===Footer===
The footer call marks the end of the shop table.
The footer call marks the end of the shop table.
<pre>{{Shop|footer}}</pre>
<pre>{{Shop|footer}}</pre>
*footer: A required parameter marking the template as the footer.
*footer: A required parameter marking the template as the footer.
==Notes on condensing tables==
It is common that in different versions of the same game a shop will sell the same items only with different names and/or prices.  The general rules to follow in this situation are:
*If only names have changed, you may use only 1 subtable to display the items.  Each item should be an interwiki link using the most recent localization name as the main link with the other name in parentheses (i.e. [[Steel Sword|Steel Sword (Broad Sword)]]). 
*If a price has changed, the subtables '''should not''' be condensed.  Attempting to condense different prices leads to clutter and makes it harder to interpret the table, especially if there are name changes also. 
*See [[Kol]] as an example of both cases.
==Example==
==Example==
===Sample===
===Sample===
{{Shop|header}}
{{Shop|header|title=[[Dragon Quest IV]]|subtitle=DS}}
{{Shop|subtable|game=[[Dragon Quest IV]]|console=DS}}
{{Shop|entry|item=[[Broad Sword]]|price=1500g}}
{{Shop|entry|item=[[Broad Sword]]|price=1500g}}
{{Shop|entry|item=[[Cloak of Evasion]]|price=2800g}}
{{Shop|entry|item=[[Cloak of Evasion]]|price=2800g}}
{{Shop|entry|item=[[Iron Helmet]]|price=2200g}}
{{Shop|entry|item=[[Iron Helmet]]|price=2200g}}
{{Shop|entry|item=[[Judgement Staff]]|price=1300g}}
{{Shop|entry|item=[[Judgement Staff]]|price=1300g}}
{{Shop|subtablefooter}}
{{Shop|footer}}
{{Shop|subtable|game=[[Dragon Quest V]]|console=DS}}
 
{{Shop|header|title=[[Dragon Quest V]]|subtitle=DS}}
{{Shop|entry|item=[[Cautery Sword]]|price=?}}
{{Shop|entry|item=[[Cautery Sword]]|price=?}}
{{Shop|entry|item=[[Flame Sword]]|price=8600g}}
{{Shop|entry|item=[[Flame Sword]]|price=8600g}}
{{Shop|subtablefooter}}
{{Shop|footer}}
{{Shop|footer}}
===Code===
===Code===
<pre>
<pre>
{{Shop|header}}
{{Shop|header|title=[[Dragon Quest IV]]|subtitle=DS}}
{{Shop|subtable|game=[[Dragon Quest IV]]|console=DS}}
{{Shop|entry|item=[[Broad Sword]]|price=1500g}}
{{Shop|entry|item=[[Broad Sword]]|price=1500g}}
{{Shop|entry|item=[[Cloak of Evasion]]|price=2800g}}
{{Shop|entry|item=[[Cloak of Evasion]]|price=2800g}}
{{Shop|entry|item=[[Iron Helmet]]|price=2200g}}
{{Shop|entry|item=[[Iron Helmet]]|price=2200g}}
{{Shop|entry|item=[[Judgement Staff]]|price=1300g}}
{{Shop|entry|item=[[Judgement Staff]]|price=1300g}}
{{Shop|subtablefooter}}
{{Shop|footer}}
{{Shop|subtable|game=[[Dragon Quest V]]|console=DS}}
 
{{Shop|header|title=[[Dragon Quest V]]|subtitle=DS}}
{{Shop|entry|item=[[Cautery Sword]]|price=?}}
{{Shop|entry|item=[[Cautery Sword]]|price=?}}
{{Shop|entry|item=[[Flame Sword]]|price=8600g}}
{{Shop|entry|item=[[Flame Sword]]|price=8600g}}
{{Shop|subtablefooter}}
{{Shop|footer}}
{{Shop|footer}}
</pre>
</pre>

Revision as of 22:55, 23 July 2010

The Shop template is used to display shop information for various locations in Dragon Quest games. This template covers all types of shops (items, tools, weapons, armor).

Usage

In almost all cases, using this template should be preceded by a heading describing the shop type on the article it is being transcluded onto (i.e.==Item Shops==). This is because there is no label marking the table as a specific type of shop within this template. This is consistent with other location templates.

Header

A header call to this template should be the first usage of this template on any page.

{{Shop|header|includeClasses|collapsed|title=[[Dragon Quest II]]|subtitle=NES}}
  • header: A required parameter which marks this as the start of a shop table.
  • includeClasses: An optional parameter marking whether this subtable should include a column for character classes. This applies when the shop has equipment which can be equipped by 1 or more characters. It should be used in association with entries that include the 'classes' parameter (see below).
  • collapsed: An optional parameter marking whether this table should be collapsed by default. Omitting it leaves the table uncollapsed.
  • title: The title to be used for this subtable. Most often this is the game this shop represents. Should be an interwiki link when applicable.
  • subtitle: An optional parameter. The subtitle to be used for this subtable. Often the console version of the game.

Entries

Each entry in the shop table is represented by a single template call. Note that the list of entries for a shop should follow the ordering of the list in-game. Also, the names of items should also be the ones used in-game, meaning they will often be redirect links.

{{Shop|entry|item=[[Broad Sword]]|price=4g per person}}
  • entry: A required parameter which marks this as a single shop table entry.
  • item: The name of the item. Should be an interwiki link.
  • price: The price of the item. Should include units of currency.
  • attributes: Attributes describing the item.
  • classes: Inter-wiki links to classes/characters that can equip this item. This field should only be used in subtables marked with 'includeClasses'.

Footer

The footer call marks the end of the shop table.

{{Shop|footer}}
  • footer: A required parameter marking the template as the footer.

Example

Sample

Dragon Quest IV (DS)
Item Price Attributes
Broad Sword 1500g {{{attributes}}}
Cloak of Evasion 2800g {{{attributes}}}
Iron Helmet 2200g {{{attributes}}}
Judgement Staff 1300g {{{attributes}}}


Dragon Quest V (DS)
Item Price Attributes
Cautery Sword ? {{{attributes}}}
Flame Sword 8600g {{{attributes}}}

Code

{{Shop|header|title=[[Dragon Quest IV]]|subtitle=DS}}
{{Shop|entry|item=[[Broad Sword]]|price=1500g}}
{{Shop|entry|item=[[Cloak of Evasion]]|price=2800g}}
{{Shop|entry|item=[[Iron Helmet]]|price=2200g}}
{{Shop|entry|item=[[Judgement Staff]]|price=1300g}}
{{Shop|footer}}

{{Shop|header|title=[[Dragon Quest V]]|subtitle=DS}}
{{Shop|entry|item=[[Cautery Sword]]|price=?}}
{{Shop|entry|item=[[Flame Sword]]|price=8600g}}
{{Shop|footer}}