Template:ShopLine: Difference between revisions
Californ1a (talk | contribs) mNo edit summary |
(add support for a "quantity" parameter on each line, must be enabled by setting quantity=true in the ShopTableHead) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<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><!-- |
||
Line 14: | Line 14: | ||
|=<td style="text-align:right;" data-sort-value="">{{Unknown}}</td> |
|=<td style="text-align:right;" data-sort-value="">{{Unknown}}</td> |
||
|#default=<td style="text-align:right;">{{Profession|{{#var:profession}}|{{{level}}}}}</td>}}|}}<!-- |
|#default=<td style="text-align:right;">{{Profession|{{#var:profession}}|{{{level}}}}}</td>}}|}}<!-- |
||
-->{{#if:{{#var:profession b}}|{{#switch:{{{level b|}}} |
|||
⚫ | --></tr |
||
|N/A=<td class="table-na" style="text-align:right;" data-sort-value="">N/A</td> |
|||
|=<td style="text-align:right;" data-sort-value="">{{Unknown}}</td> |
|||
|#default=<td style="text-align:right;">{{Profession|{{#var:profession b}}|{{{level b}}}}}</td>}}|}}<!-- |
|||
-->{{#if:{{#var:profession c}}|{{#switch:{{{level c|}}} |
|||
|N/A=<td class="table-na" style="text-align:right;" data-sort-value="">N/A</td> |
|||
|=<td style="text-align:right;" data-sort-value="">{{Unknown}}</td> |
|||
|#default=<td style="text-align:right;">{{Profession|{{#var:profession c}}|{{{level c}}}}}</td>}}|}}<!-- |
|||
-->{{#if:{{#var:quantity}}|{{#switch:{{{quantity|}}} |
|||
|N/A=<td class="table-na" style="text-align:right;" data-sort-value="">N/A</td> |
|||
|=<td style="text-align:right;" data-sort-value="">{{Unknown}}</td> |
|||
|#default=<td style="text-align:right;">{{{quantity}}}</td>}}|}}<!-- |
|||
⚫ |
Latest revision as of 00:18, 23 December 2024
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 Eel | 412 | 165 | |||||||||||||||||||
Gray Eel | 525 | 210 | |||||||||||||||||||
Rocky Eel | 702 | 270 |
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
- Image size is optional (i.e. to resize the image to 25 pixels by 25 pixels, add this at the end:
- level: (optional) The level to show in the level column. Requires the profession to be set to be shown in the
{{ShopTableHead}}
. - quantity: (optional) The quantity to show in the quantity column. Requires the quantity 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.
|