Diferencia entre revisiones de «Plantilla:Icono moneda»

De Inkipedia
(Added Golden Egg)
(Reinventing the wheel is my specialty. And it was my wheel!)
Línea 1: Línea 1:
{{ImageLabel|{{#switch:{{{currency|Cash}}}
<includeonly>{{User:GuyPerfect/BoxLabel|
[[File:{{#switch:{{#if:{{{currency|}}}|{{{currency}}}|cash}}
|sss      = Super Sea Snail.png
|sss      = Super Sea Snail.png
|pe      = Power Egg.png
|pe      = Power Egg.png
|ge      = Golden Egg.png
|#default = Coins.png
|#default = Coins.png
}}|{{{1|}}}
}}|{{{2|24px}}}|{{#switch:{{#if:{{{currency|}}}|{{{currency}}}|cash}}
|size={{{2|30px}}}|link={{#switch:{{{currency|Cash}}}
|sss      = Super Sea Snails
|pe      = Power Eggs
|#default = Cash
}}|link={{#switch:{{#if:{{{currency|}}}|{{{currency}}}|cash}}
|sss      = Super Sea Snail
|sss      = Super Sea Snail
|pe      = Power Egg
|pe      = Power Egg
|ge      = Golden Egg
|#default = Cash
|#default = Cash
}}
}}]]{{#ifeq:{{{icononly|}}}|true||<span style="display: inline-block; text-align: right; {{#if:{{{width|}}}|width: {{{width}}};}}">&nbsp;[[{{#switch:{{#if:{{{currency|}}}|{{{currency}}}|cash}}
|width={{{width|auto}}}
|sss      = Super Sea Snail
|align={{{align|left}}}
|pe      = Power Egg
}}<noinclude>
|#default = Cash
}}|{{{1}}}]]</span>}}
}}</includeonly><noinclude>
__NOTOC__
Displays an inline currency icon with a text link.
 
=== Parameters ===
{|
|- style="vertical-align: top;"
|<code>price</code>||Unnamed.||The numeric price to display.
|- style="vertical-align: top;"
|<code>size</code>||Unnamed, optional.||A MediaWiki image size value to use for the icon. The default size is 24px.
|- style="vertical-align: top;"
|<code>currency</code>||Optional.||The type of currency to display. The default value is "cash". Must be one of the following:
* [[File:Coins.png|20px|Cash|link=Cash]] cash
* [[File:Power Egg.png|20px|Power Eggs|link=Power Egg]] pe
* [[File:Super Sea Snail.png|20px|Super Sea Snails|link=Super Sea Snail]] sss
|- style="vertical-align: top;"
|<code>icononly</code>||Optional.||If present and set to <code>true</code>, the text label will be omitted.
|- style="vertical-align: top;"
|<code>width</code>||Optional.||A CSS width value to use for the text label. The text itself will be right-aligned.
|}


;Summary
=== Examples ===
A handy template for putting the [[Cash]], [[Super Sea Snail]], [[Power Egg]], or [[Golden Egg]] icon next to a price.


; Usage
==== Markup ====
* {{t|cost|amount}} for a simple cost in cash.
<nowiki>{{Cost|200}}<br />
* {{t|cost|amount|size}} makes it 24 pixels wide.
{{Cost|200|48px}}<br />
* {{t|cost|amount|currency{{=}}}} to select the currency
{{Cost|200|currency=pe}}<br />
* {{t|cost|amount|currency{{=}}sss}} shows [[Super Sea Snail]] cost.
{{Cost|currency=sss|icononly=true}}<br />
* {{t|cost|amount|currency{{=}}pe}} shows [[Power Egg]] cost.
{{Cost|200|width=50px}}</nowiki>
* {{t|cost|amount|currency{{=}}ge}} shows [[Golden Egg]] cost.


; Examples
==== Output ====
* <nowiki>{{Cost|400|48px}}</nowiki> gives {{Cost|400|48px}}
{{User:GuyPerfect/Cost|200}}<br />
* <nowiki>{{Cost|1|24px|currency=sss}}</nowiki> gives {{Cost|1|24px|currency=sss}}
{{User:GuyPerfect/Cost|200|48px}}<br />
* <nowiki>{{Cost|300|12px|currency=pe}}</nowiki> gives {{Cost|300|12px|currency=pe}}
{{User:GuyPerfect/Cost|200|currency=pe}}<br />
* <nowiki>{{Cost|250|36px|currency=ge}}</nowiki> gives {{Cost|250|36px|currency=ge}}
{{User:GuyPerfect/Cost|currency=sss|icononly=true}}<br />
{{User:GuyPerfect/Cost|200|width=50px}}


</noinclude>
</noinclude>

Revisión del 04:11 1 ago 2017


Displays an inline currency icon with a text link.

Parameters

price Unnamed. The numeric price to display.
size Unnamed, optional. A MediaWiki image size value to use for the icon. The default size is 24px.
currency Optional. The type of currency to display. The default value is "cash". Must be one of the following:
icononly Optional. If present and set to true, the text label will be omitted.
width Optional. A CSS width value to use for the text label. The text itself will be right-aligned.

Examples

Markup

{{Cost|200}}<br />
{{Cost|200|48px}}<br />
{{Cost|200|currency=pe}}<br />
{{Cost|currency=sss|icononly=true}}<br />
{{Cost|200|width=50px}}

Output

Usuario:GuyPerfect/Cost
Usuario:GuyPerfect/Cost
Usuario:GuyPerfect/Cost
Usuario:GuyPerfect/Cost
Usuario:GuyPerfect/Cost