Template:ShopLine: Difference between revisions

From Brighter Shores Wiki
Jump to navigation Jump to search
Content added Content deleted
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{ShopTableHead}}<onlyinclude><tr><!--
<includeonly><tr>
<td>{{#if:{{{image|}}}|[[File:{{{image}}}|30px|link={{{name}}}]]|[[File:{{{name}}}.png|30px]]}}</td>
--><td>{{#if:{{{image|}}}|[[File:{{{image}}}|30px|link={{{name}}}]]|[[File:{{{name}}}.png|30px]]}}</td><!--
<td>{{#if:{{{displayname|}}}|[[{{{name}}}|{{{displayname}}}]]|[[{{{name}}}]]}}</td>
--><td>{{#if:{{{displayname|}}}|[[{{{name}}}|{{{displayname}}}]]|[[{{{name}}}]]}}</td><!--
-->{{#switch:{{{buy|}}}
<td {{#ifeq:{{{buy|}}}|N/A|class="table-na" style="text-align:center"}}>{{#if:{{{buy|}}}|{{#ifeq:{{{buy|}}}|N/A|N/A|{{Currency|{{{buy}}}}}}}|{{Unknown}}}}</td>
|N/A=<td colspan="10" class="table-na" data-sort-value="">N/A</td>
<td {{#ifeq:{{{sell|}}}|N/A|class="table-na" style="text-align:center"}}>{{#if:{{{sell|}}}|{{#ifeq:{{{sell|}}}|N/A|N/A|{{Currency|{{{sell}}}}}}}|{{Unknown}}}}</td>
|=<td colspan="10" data-sort-value="">{{Unknown}}</td>
{{#varexists:profession|<td>{{#if:{{{level|}}}|{{{level}}}|{{Unknown}}}}</td>|}}
|{{Currency cell|{{{buy}}}|html=yes}}}}<!--
</tr>{{#subobject:{{{name}}}_{{#if:{{{sell|}}}|{{{sell}}}|Unknown}}_{{#if:{{{buy|}}}|{{{buy}}}|Unknown}}|Sold by={{FULLPAGENAME}}|Sold item={{{name}}}|Shop buy price={{#if:{{{buy|}}}|{{{buy}}}|}}|Shop sell price={{#if:{{{sell|}}}|{{{sell}}}|}}}}</includeonly><noinclude>{{/doc}}</noinclude>
-->{{#switch:{{{sell|}}}
|N/A=<td colspan="10" class="table-na" data-sort-value="">N/A</td>
|=<td colspan="10" data-sort-value="">{{Unknown}}</td>
|{{Currency cell|{{{sell}}}|html=yes}}}}<!--
-->{{#varexists:profession|<td>{{#if:{{{level|}}}|{{Profession|{{#var:profession}}|{{{level}}}|1}}|{{Unknown}}}}</td>|}}<!--
--></tr><includeonly>{{#subobject:{{{name}}}_{{#if:{{{sell|}}}|{{{sell}}}|Unknown}}_{{#if:{{{buy|}}}|{{{buy}}}|Unknown}}|Sold by={{FULLPAGENAME}}|Sold item={{{name}}}|Shop buy price={{#if:{{{buy|}}}|{{{buy}}}|}}|Shop sell price={{#if:{{{sell|}}}|{{{sell}}}|}}}}</includeonly></onlyinclude>{{ShopTableBottom}}{{/doc}}

Latest revision as of 21:57, 20 November 2024

Item Buy price Sell price
[[File:{{{name}}}.png|30px]][[{{{name}}}]]Unknown (edit)Unknown (edit)
Template documentation
This documentation is transcluded from Template:ShopLine/doc. [edit] [history] [purge]

The ShopLine template is used to fill out tables commonly used in Shops to provide a listing of items that are found in that shop. It also helps to provide a uniform look of how the shop information is presented for all articles about shop on the wiki.

Note: Profession can be set in the {{ShopTableHead}} for the whole table.

Usage

The ShopLine templates are used to list a shop's stock. Three templates are used to form the stock table:

  • {{ShopTableHead}} - Contains table headers for the top of the shop stock table
  • {{ShopLine}} - Template for each line item in the shop
  • {{ShopTableBottom}} - Contains bottom of the table and the reference list for the shop stock table

For example:

{{ShopTableHead}}
{{ShopLine|name=Lesser Eel|buy=412|sell=165}}
{{ShopLine|name=Gray Eel|buy=525|sell=210}}
{{ShopLine|name=Rocky Eel|buy=702|sell=270}}
{{ShopTableBottom}}

gives

Item Buy price Sell price
Lesser Eel412Copper165Copper
Gray Eel525Copper210Copper
Rocky Eel702Copper270Copper

Parameters

  • name: the item (should be the page name)
  • displayname: (optional) an optional name for the item
  • buy: price at which the player can buy the item from the shop.
  • sell: price at which the player can sell the item to the shop.
  • image: (optional) alternative image to override the image that matches the item name.
    • Image size is optional (i.e. to resize the image to 25 pixels by 25 pixels, add this at the end: {{!}}25x25px
  • level: (optional) The level to show in the level column. Requires the profession to be set to be shown in the {{ShopTableHead}}.

Blank template

{{ShopLine|name=|buy=|sell=}}
{{ShopLine|name=|buy=|sell=|level=}}

See also

Template data

Show/hide template's data

The following information is used by extensions and applications, such as VisualEditor, to help users implement this template onto pages. Please ensure that it is up-to-date.

Template for generating tables of items sold by shops.

Template parameters[Edit template data]

This template has custom formatting.

ParameterDescriptionTypeStatus
Namename

Name of item as it appears on page.

Example
Lesser Eel
Page namerequired
Display Namedisplayname

The name of the item to display

Example
Another Lesser Eel
Stringoptional
Buy Pricebuy

The price the player can buy the item for.

Example
100
Stringrequired
Sell Pricesell

The price the player can sell the item for.

Example
100
Stringrequired
Imageimage

An alternative image to override the image that matches the item name.

Example
Lesser Eel.png
Stringoptional
Levellevel

The profession level required for being able to purchase an item.

Example
10
Numberoptional