This template is protected from editing.
Difference between revisions of "Template:Item price"
(Added attribute "tooltips" to show/hide currency-symbol tooltips.) |
(Performance update.) |
||
Line 1: | Line 1: | ||
− | {{# | + | {{#switch:{{lc:{{{1|{{{2|{{{currency|}}}}}}}}}}} |
− | + | | usd = <!-- | |
− | | | + | -->{{{{#ifeq:{{{tooltips|yes}}}|yes|tooltip|1}}|$|United States dollars}}<!-- |
− | | | + | -->{{Item price/core|currency=usd|item={{{item|{{BASEPAGENAME}}}}}}} |
− | |||
− | | | + | | gbp = <!-- |
− | + | -->{{{{#ifeq:{{{tooltips|yes}}}|yes|tooltip|1}}|£|Pound sterling}}<!-- | |
− | --> | + | -->{{Item price/core|currency=gbp|item={{{item|{{BASEPAGENAME}}}}}}} |
− | |||
− | |||
− | |||
− | --> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | + | | eur = <!-- |
− | + | -->{{Item price/core|currency=eur|item={{{item|{{BASEPAGENAME}}}}}}}<!-- | |
− | --> | + | -->{{{{#ifeq:{{{tooltips|yes}}}|yes|tooltip|1}}|€|Euros}} |
− | + | ||
− | + | | #default = <!-- | |
− | + | # All of the above neatly combined. | |
− | + | -->{{{{#ifeq:{{{tooltips|yes}}}|yes|tooltip|1}}|$|United States dollars}}<!-- | |
− | + | -->{{Item price/core|currency=usd|item={{{item|{{BASEPAGENAME}}}}}}}<!-- | |
− | + | ||
− | + | --> / <!-- | |
+ | -->{{{{#ifeq:{{{tooltips|yes}}}|yes|tooltip|1}}|£|Pound sterling}}<!-- | ||
+ | -->{{Item price/core|currency=gbp|item={{{item|{{BASEPAGENAME}}}}}}}<!-- | ||
+ | |||
+ | --> / <!-- | ||
+ | -->{{Item price/core|currency=eur|item={{{item|{{BASEPAGENAME}}}}}}}<!-- | ||
+ | -->{{{{#ifeq:{{{tooltips|yes}}}|yes|tooltip|1}}|€|Euros}} | ||
+ | |||
+ | }}<noinclude>{{doc begin}} | ||
+ | * {{tl|Item price}} is used to format prices with {{tl|tooltip}}s and the proper currency symbols. | ||
+ | * {{tl|Item price/core}} is used to get the price directly. | ||
+ | * '''{{tl|Dictionary/price}}''' stores the actual price values. Edit them there. | ||
=== Usage === | === Usage === | ||
− | * {{tlx|item price| | + | * {{tlx|item price|2=currency=usd}} on the article [[Black Box]] generates: {{item price|item=Black Box|currency=usd}} |
− | * {{tlx|item price| | + | * {{tlx|item price|2=item=Familiar Fez}} generates: {{item price|item=Familiar Fez}} |
− | * You can also remove the tooltips on the currency symbols: {{tlx|item price | + | * You can also remove the tooltips on the currency symbols: {{tlx|item price|3=item=Degreaser|4=tooltips=no}} generates: {{item price|item=Degreaser|tooltips=no}} |
[[Category:Templates|Item price]] | [[Category:Templates|Item price]] | ||
</noinclude> | </noinclude> |
Revision as of 09:49, 16 April 2011
$Template:Dictionary/price/item price / £Template:Dictionary/price/item price / Template:Dictionary/price/item price€
Documentation for Item price
{{Item price}}
is used to format prices with{{tooltip}}
s and the proper currency symbols.{{Item price/core}}
is used to get the price directly.{{Dictionary/price}}
stores the actual price values. Edit them there.
Usage
{{item price|currency=usd}}
on the article Black Box generates: $1.99{{item price|item=Familiar Fez}}
generates: $7.49 / £5.99 / 7.15€ / 695rub / R$ 37.99 / 30.95zł- You can also remove the tooltips on the currency symbols:
{{item price|item=Degreaser|tooltips=no}}
generates: $1.99 / £1.59 / 1.89€ / 185rub / R$ 9.99 / 8.25zł