Template:CostLine/doc: Difference between revisions

From RuneRealm Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "{{Documentation|Template:CostLine}} The '''CostTable''' templates are used to display the cost of one or multiple items, and can calculate a total to display at the bottom. ==Usage== <pre> {{CostTableHead |caption = <!-- (Optional) Adds a caption to the table --> |quantity = <!-- (Optional) Display the quantity column --> |class = <!-- (Optional) Additional classes for the table --> |style = <!-- (Optional) Allows for style overrides in the table head --> }}...")
 
No edit summary
 
Line 69: Line 69:
|{{*}}||'''compare''':||(Optional) Adds an additional item to compare the total cost to. Intended for comparing set items with their individual pieces. See below for an example.
|{{*}}||'''compare''':||(Optional) Adds an additional item to compare the total cost to. Intended for comparing set items with their individual pieces. See below for an example.
|-
|-
|{{*}}||'''gemwname''':||(Optional) Provides an override to the displayed link text and the string that is passed to the <code><nowiki>{{GEP}}</nowiki></code> template. Mostly for mw.pages where the page name differs from the item's actual name.
|{{*}}||'''gemwname''':||(Optional) Provides an override to the displayed link text and the string that is passed to the <code><nowiki>{{GEP}}</nowiki></code> template. Mostly for pages where the page name differs from the item's actual name.
|-
|-
|{{*}}||'''quantity''':||(Optional) Changes the quantity of the item, defaults to 1. Useful when a recipe produces more than 1 of something at a time.
|{{*}}||'''quantity''':||(Optional) Changes the quantity of the item, defaults to 1. Useful when a recipe produces more than 1 of something at a time.

Latest revision as of 11:33, 17 October 2024

This is a documentation subpage for Template:CostLine.
It contains usage information, categories, and other content that is not part of the original template page.

The CostTable templates are used to display the cost of one or multiple items, and can calculate a total to display at the bottom.

Usage

{{CostTableHead
|caption   = <!-- (Optional) Adds a caption to the table -->
|quantity  = <!-- (Optional) Display the quantity column -->
|class     = <!-- (Optional) Additional classes for the table -->
|style     = <!-- (Optional) Allows for style overrides in the table head -->
}}
{{CostLine
|1         = <!-- Name of the item -->
|txt       = <!-- (Optional) Text override -->
|pic       = <!-- (Optional) Image override -->
|gif       = <!-- (Optional) Change image to gif -->
|quantity  = <!-- (Optional) Change item quantity -->
|namenotes = <!-- (Optional) Text after item name -->
|cost      = <!-- (Optional) Cost override -->
|costmax   = <!-- (Optional) Allows for a cost range with multiple items -->
|costref   = <!-- (Optional) Places text after cost, meant for references -->
}}
{{CostTableBottom
|total     = <!-- (Optional) Display total cost of items in the table. -->
|compare   = <!-- (Optional) Name of an item to compare to the total sum. Intended for item sets -->
|pic       = <!-- (Optional) Image override -->
|quantity  = <!-- (Optional) Change item quantity -->
|gemwname  = <!-- (Optional) Override for GE name -->
}}

CostTableHead

caption: (Optional) Adds a caption to the table
quantity: (Optional) Use the parameter quantity=yes to display the quantity column.
class: (Optional) Add more classes on top of the wikitable align-left-2. (AKA sortable, mw-collapsible, etc.)
style: (Optional) Add additional style styling to the table. See first example.

CostLine

1: This parameter takes the name of the item
txt: (Optional) Alternate text in the link; defaults to the first parameter
pic: (Optional) If included, this changes the filename used; defaults to the first parameter; do not include "File:" or ".png"
gif: (Optional) Use the parameter gif=yes if the image is a GIF file. If parameter is not given, defaults to no.
quantity: (Optional) Changes the quantity of the item, defaults to {{{2}}}.
2: (Optional) Overrides quantity for the lazy people that don't want to write quantity= every time. Defaults to 1.
namenotes: (Optional) Adds some additional text after the link to the item
cost: (Optional) Override for the item cost for untradeables, cost ranges, etc. Set cost=no to replace the cell with the {{NA}} template (this treats the cost as 0 as well).
costmax: (Optional) If making a range, this is the upper bound. The cost parameter is the lower bound. See below for an example.
costref: (Optional) Adds text immediately after cost (or costmax if it exists). Intended for adding references.

CostTableBottom

total: (Optional) Use the parameter total=y to display the total cost of the items in the table.
compare: (Optional) Adds an additional item to compare the total cost to. Intended for comparing set items with their individual pieces. See below for an example.
gemwname: (Optional) Provides an override to the displayed link text and the string that is passed to the {{GEP}} template. Mostly for pages where the page name differs from the item's actual name.
quantity: (Optional) Changes the quantity of the item, defaults to 1. Useful when a recipe produces more than 1 of something at a time.
pic: (Optional) Just like the above pic parameter, use this to override the displayed image.

Examples

{{CostTableHead|quantity=yes|style=width:40%;}}
{{CostLine|Bagged nice tree
|txt=Happiness
|cost=NO}}
{{CostLine|Pink dye|quantity=1000|cost=20}}
{{CostLine|Bucket of sand|quantity=6}}
{{CostLine|Watering can(8)
|cost={{GEP|Watering can}}
}}
{{CostLine|Saradomin d'hide body
|txt=woooooooo
}}
{{CostTableBottom|total=y}}
Item Quantity GE Price
Happiness 1 N/A
Pink dye 1,000 20,000
Bucket of sand 6 294
Watering can(8) 1 Lua error: .
woooooooo 1 281,155
Total Lua error: .
{{CostTableHead}}
{{CostLine|Ankou mask}}
{{CostLine|Ankou top}}
{{CostLine|Ankou's leggings}}
{{CostLine|Ankou gloves}}
{{CostLine|Ankou socks}}
{{CostTableBottom|total=y}}
Item GE Price
Ankou mask 9,934,344
Ankou top 22,139,895
Ankou's leggings Lua error: .
Ankou gloves 6,559,628
Ankou socks 5,025,850
Total Lua error: .
{{CostTableHead|quantity=yes|caption=Torn curtains}}
{{CostLine|Plank|quantity=3}}
{{CostLine|Bolt of cloth|quantity=3}}
{{CostLine|Nails
|namenotes=(any)
|pic=Bronze nails
|quantity=3
|cost=   {{NailsCost|min}}
|costmax={{NailsCost|max}}
|costref=<ref>Cost changes depending on the type of nails used.</ref>
}}
{{CostTableBottom|total=y}}
{{reflist}}
Torn curtains
Item Quantity GE Price
Plank 3 828
Bolt of cloth 3 2,532
Nails (any) 3 33 - 3,360[1]
Total 3,393 - 6,720
  1. ^ Cost changes depending on the type of nails used.
{{CostTableHead|quantity=YES|caption=Oak chair}}
{{CostLine|Oak plank|quantity=2}}
{{CostTableBottom}}
Oak chair
Item Quantity GE Price
Oak plank 2 840
{{CostTableHead}}
{{CostLine|Justiciar faceguard}}
{{CostLine|Justiciar chestguard}}
{{CostLine|Justiciar legguards}}
{{CostTableBottom|total=y|compare=Justiciar armour set}}
Item GE Price
Justiciar faceguard 11,863,752
Justiciar chestguard 49,439,987
Justiciar legguards 44,628,798
Total 105,932,537
Justiciar armour set 105,932,537
Difference 0
{{CostTableHead|quantity=yes}}
{{CostLine|Mahogany plank|3}}
{{CostLine|Bolt of cloth|2}}
{{CostTableBottom|total=y|compare=Four-poster bed (flatpack)}}
Item Quantity GE Price
Mahogany plank 3 6,348
Bolt of cloth 2 1,688
Total 8,036
File:Four-poster bed (flatpack).png Four-poster bed (flatpack) 1 Lua error: .
Difference Lua error: .