Difference between revisions of "Template:PriceRow/doc"

From ELWiki
Jump to navigation Jump to search
(created page)
 
(edited docs for 15-cell maximum)
Line 1: Line 1:
 
==Usage==
 
==Usage==
This is a template for inserting a row in tables of item prices on el-wiki.  It should only be used inside a table that is declared with wikitext.  It creates 1 (one) table row using wikitext which contains 3 (three) columns.  The first column contains the picture of the item followed by the name of the item linked to the item's page.  The second column contains an optional price to be displayed in the "Buy item" column.  The third column contains an optional price to be displayed in the "Sell item" column.
+
This is a template for inserting a row in tables of item prices on el-wiki.  It should only be used inside a table that is declared with wikitext.  It creates 1 (one) table row using wikitext which can contain a maximum of 15 cells.  The first cell contains a picture of the item followed by the name of the item linked to the item's page.  The cells following it are formatted for numerical prices associated with the headings of the columns.
  
This template is designed to be used inside the {{tl|PriceTable}} template, but it can be used in any wikitext table.
+
This template is designed to be used after the {{tl|PriceTableHeader}} template, but it can be used in any wikitext table.
  
 +
<pre>
 +
{{PriceRow|name of item(required)|price(optional)|price(optional)|price(optional)|...}}
 +
</pre>
 +
 +
It will most likely be used in the form:
 
<pre>
 
<pre>
 
{{PriceRow|name of item|optional "Buy item" price|optional "Sell item" price}}
 
{{PriceRow|name of item|optional "Buy item" price|optional "Sell item" price}}
Line 38: Line 43:
  
 
==Notes==
 
==Notes==
The name of the item is '''required''' for the row to be displayed.  The name of the item must match the spelling and capitalization of item's page name and picture name.  This template expects the image to have a PNG extension (*.png).  Most of the images on el-wiki are in PNG format anyway.
+
The name of the item is '''required''' for the row to be displayed.  The name of the item must match the spelling, capitalization, and spacing of item's page name and picture name.  This template expects the image to have a PNG extension (*.png).  Most of the images on el-wiki are in PNG format anyway.
 +
 
 +
In the price parameters, only '''numerical values greater than 0 (zero)''' are allowed.  If any non-numerical values are included in those columns, the table will sort those columns according to ASCII (alphabetic) values rather than numerically.  For example, putting the words "gold coins" in each cell to indicate the units would cause improper sorting by ASCII.  Instead, include a note clarifying the units elsewhere on the page. (The {{tl|PriceTableFooter}} template includes a note at the bottom of the table.)
  
In the "buy" and "sell" parameters, only numerical values greater than 0 (zero) are allowed.  If any non-numerical values are included in those columns, the table will sort those columns according to ASCII (alphabetic) values rather than numerically.  Putting the words "gold coins" in each cell to indicate the units would cause improper sorting by ASCII.  Instead, include a note clarifying the units elsewhere on the page. (The {{tl|PriceTable}} template includes a note at the bottom of the table.)
+
In the game, if the item is not listed in the "Buy item" or "Sell item" text menus of the associated NPC, leave that parameter in this template blank or empty.  Do not write "0" (zero) for the price as this would imply that the item can be traded for 0 gold coins, which is not possible.
  
In the game, if the item is not listed in the "Buy" or "Sell" text menus of the associated NPC, leave that parameter in this template blank or emptyDo not write "0" (zero) for the price as this would imply that the item can be traded for 0 gold coins, which is not possible.
+
This template may append up to 14 price cells to the name cell.  A 2-column row containing only the item cell and the "Buy" price, for example, can be created by calling this template with only one price parameterEach new price cell is appended to the row by typing "'''|'''" (pipe or vertical bar) followed by the cell's contents (which can be empty).
  
 
The background color of the row has been set to be slightly darker than the current (as of September 2010) el-wiki page background color.
 
The background color of the row has been set to be slightly darker than the current (as of September 2010) el-wiki page background color.
Line 52: Line 59:
  
 
==See also==
 
==See also==
*{{tl|PriceTable}}
+
*{{tl|PriceTableHeader}}
 +
*{{tl|PriceTableFooter}}
  
 
<includeonly>
 
<includeonly>
 
[[Category:Meta Templates|{{PAGENAME}}]]
 
[[Category:Meta Templates|{{PAGENAME}}]]
 
</includeonly>
 
</includeonly>

Revision as of 09:53, 18 September 2010

Usage

This is a template for inserting a row in tables of item prices on el-wiki. It should only be used inside a table that is declared with wikitext. It creates 1 (one) table row using wikitext which can contain a maximum of 15 cells. The first cell contains a picture of the item followed by the name of the item linked to the item's page. The cells following it are formatted for numerical prices associated with the headings of the columns.

This template is designed to be used after the {{PriceTableHeader}} template, but it can be used in any wikitext table.

{{PriceRow|name of item(required)|price(optional)|price(optional)|price(optional)|...}}

It will most likely be used in the form:

{{PriceRow|name of item|optional "Buy item" price|optional "Sell item" price}}

Example

{| class="sortable" style="border:1px solid grey; border-collapse:collapse; background:#e0e4c5;" cellpadding="3" cellspacing="0"
|-
!scope="col" style="border:1px solid grey; background: #d1d7b1;" | Item
!scope="col" style="border:1px solid grey; background: #d1d7b1;" | "Buy item" for
!scope="col" style="border:1px solid grey; background: #d1d7b1;" | "Sell item" for
{{PriceRow|Santa Hat||21}}
{{PriceRow||32|48}} <!-- item name is missing on purpose for this example -->
{{PriceRow|White Robe|42|250}}
{{PriceRow|Sulfr|3|6}} <!-- item name is misspelled on purpose for this example -->
{{PriceRow|Brown Tunic Blue Shirt|10|}}
|}
Item "Buy item" for "Sell item" for
Santa Hat.png Santa Hat 21
White Robe.png White Robe 42 250
File:Sulfr.png Sulfr 3 6
Brown Tunic Blue Shirt.png Brown Tunic Blue Shirt 10
  • "Sulfr" is misspelled on purpose for this example.
  • One row is missing because the item name for that row was not written as a parameter in the template for that row (see the example code above).

Notes

The name of the item is required for the row to be displayed. The name of the item must match the spelling, capitalization, and spacing of item's page name and picture name. This template expects the image to have a PNG extension (*.png). Most of the images on el-wiki are in PNG format anyway.

In the price parameters, only numerical values greater than 0 (zero) are allowed. If any non-numerical values are included in those columns, the table will sort those columns according to ASCII (alphabetic) values rather than numerically. For example, putting the words "gold coins" in each cell to indicate the units would cause improper sorting by ASCII. Instead, include a note clarifying the units elsewhere on the page. (The {{PriceTableFooter}} template includes a note at the bottom of the table.)

In the game, if the item is not listed in the "Buy item" or "Sell item" text menus of the associated NPC, leave that parameter in this template blank or empty. Do not write "0" (zero) for the price as this would imply that the item can be traded for 0 gold coins, which is not possible.

This template may append up to 14 price cells to the name cell. A 2-column row containing only the item cell and the "Buy" price, for example, can be created by calling this template with only one price parameter. Each new price cell is appended to the row by typing "|" (pipe or vertical bar) followed by the cell's contents (which can be empty).

The background color of the row has been set to be slightly darker than the current (as of September 2010) el-wiki page background color.

More info:

See also