Diferencia entre revisiones de «Plantilla:Icono moneda»

De Inkipedia
(Restore width paramter)
(Removing Legacy parameter support. Leaving the category in for another few hours, just to make sure that it cleans out properly once the job queue is done.)
Línea 1: Línea 1:
<includeonly>[[File:{{#iferror:{{#expr:{{{1}}}}}|{{{1}}}|{{#switch:{{{game}}}
<includeonly>[[File:{{{1}}} Icon {{#switch:{{{3|{{{currency|cash}}}}}}
|Splatoon 2=S2
|Splatoon
|#default=S}}}} Icon {{#switch:{{{3|{{{currency|cash}}}}}}
|pe=Power Egg
|pe=Power Egg
|sss=Super Sea Snail
|sss=Super Sea Snail
|ge=Golden Egg
|ge=Golden Egg
|sard
|sard=Sardinium Shadow
|sardinium=Sardinium Shadow
|ac=Ability Chunk Generic
|ac=Ability Chunk Generic
|cash
|cash
|#default=Cash}}.png|{{#iferror:{{#expr:{{{1}}}}}|{{#iferror:{{#expr:{{{4|24}}}}}|24}}px|{{{2|24px}}}}}|{{#switch:{{{3|{{{currency|cash}}}}}}
|#default=Cash}}.png|{{#iferror:{{#expr:{{{4|24}}}}}|24}}px|{{#switch:{{{3|{{{currency|cash}}}}}}
|pe=Power Egg{{#ifeq:{{{2}}}|1||s}}
|pe=Power Egg{{#ifeq:{{{2}}}|1||s}}
|sss=Super Sea Snail{{#ifeq:{{{2}}}|1||s}}
|sss=Super Sea Snail{{#ifeq:{{{2}}}|1||s}}
|ge=Golden Egg{{#ifeq:{{{2}}}|1||s}}
|ge=Golden Egg{{#ifeq:{{{2}}}|1||s}}
|sard
|sard=Sardinium
|sardinium=Sardinium
|ac=Ability Chunk{{#ifeq:{{{2}}}|1||s}}
|ac=Ability Chunk{{#ifeq:{{{2}}}|1||s}}
|cash
|cash
Línea 22: Línea 17:
|sss=Super Sea Snail
|sss=Super Sea Snail
|ge=Golden Egg
|ge=Golden Egg
|sard
|sard=Sardinium
|sardinium=Sardinium
|ac=Ability Chunk
|ac=Ability Chunk
|cash
|cash
|#default=Cash}}]]<span style="display: inline-block; text-align: right; {{#if:{{{6|{{{width|}}}}}}|width:{{{width|{{{6|}}}px}}}}}">{{#ifeq:{{#if:{{#ifeq:{{{icononly}}}|true|1}}{{#iferror:{{#expr:{{{1}}}}}|{{#if:{{{2|}}}||2}}|}}|nolink}}{{{5|{{{4|{{#ifeq:{{{link}}}|true|link}}}}}}}}|link|[[{{#switch:{{{3|{{{currency|cash}}}}}}
|#default=Cash}}]]<span style="display: inline-block; text-align: right; {{#if:{{{6|}}}|width:{{{6|}}}px}}">{{#if:{{{2|}}}|&#32;{{#ifeq:{{{5|{{{4|}}}}}}|link|[[{{#switch:{{{3|{{{currency|cash}}}}}}
|pe=Power Egg
|pe=Power Egg
|sss=Super Sea Snail
|sss=Super Sea Snail
|ge=Golden Egg
|ge=Golden Egg
|sard
|sard=Sardinium
|sardinium=Sardinium
|ac=Ability Chunk
|ac=Ability Chunk
|cash
|cash
|#default=Cash}}|{{#iferror:{{#expr:{{{1}}}}}|{{#if:{{{2|}}}|&#32;{{{2}}}}}|{{#ifeq:{{{icononly}}}|true||&#32;{{{1|}}}}}}}]]|{{#iferror:{{#expr:{{{1}}}}}|{{#if:{{{2|}}}|&#32;{{{2}}}}}|{{#ifeq:{{{icononly}}}|true||&#32;{{{1|}}}}}}}}}</span><!--Helper categories, only for locating issues-->{{#if:{{{currency|}}}{{{icononly|}}}{{{game|}}}{{{link|}}}{{#iferror:{{#expr:{{{1}}}}}||!}}|[[Category:Pages_that_use_the_old_format_of_the_Cost_Template]]}}</includeonly><noinclude>__NOTOC__
|#default=Cash}}|{{{2}}}]]|{{{2}}}}}}}</span><!--Helper category, only for locating issues-->{{#if:{{{currency|}}}{{{icononly|}}}{{{game|}}}{{{link|}}}{{#iferror:{{#expr:{{{1}}}}}||!}}|[[Category:Pages_that_use_the_old_format_of_the_Cost_Template]]}}</includeonly><noinclude>__NOTOC__
Displays an inline currency icon with a text link.
Displays an inline currency icon with a text link.
{{!!}} '''This template is undergoing a hand-over-hand change. Please do not use the legacy parameter set!'''


=== Usage ===
=== Usage ===
Línea 111: Línea 102:
*{{Cost|S|200|cash|24|link|60}}
*{{Cost|S|200|cash|24|link|60}}
*{{Cost|S|200|cash|24| |60}}
*{{Cost|S|200|cash|24| |60}}
=== Legacy 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:S_Icon_Cash.png|20px|link=]] [[File:S2_Icon_Cash.png|20px|link=]] cash
* [[File:S_Icon_Power Egg.png|20px|link=]] [[File:S2_Icon_Power Egg.png|20px|link=]] pe
* [[File:S_Icon_Super Sea Snail.png|20px|link=]] [[File:S2_Icon_Super Sea Snail.png|20px|link=]] sss
* [[File:S2_Icon_Golden Egg.png|20px|link=]] ge
* [[File:S2_Icon_Sardinium_Shadow.png|20px|link=]] sardinium
* [[File:S2_Icon_Ability_Chunk_Generic.png|20px|link=]] ac
|- style="vertical-align: top;"
|<code>game</code>||Optional.||The game the cost applies to. The default value is "Splatoon". Must be one of the following:
*Splatoon
*Splatoon 2
|- style="vertical-align: top;"
|<code>link</code>||Optional.||If present and set to <code>true</code>, the text label will be a link.
|- 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.
|}
=== Legacy Examples ===
==== Markup ====
<nowiki>{{Cost|200}}<br />
{{Cost|200|48px}}<br />
{{Cost|200|currency=pe}}<br />
{{Cost|200|currency=sss|link=true}}<br />
{{Cost|200|icononly=true}}<br />
{{Cost|200|width=50px}}<br />
{{Cost|200|game=Splatoon 2}}</nowiki>
==== Output ====
{{Cost|200}}<br />
{{Cost|200|48px}}<br />
{{Cost|200|currency=pe}}<br />
{{Cost|200|currency=sss|link=true}}<br />
{{Cost|200|icononly=true}}<br />
{{Cost|200|width=50px}}<br />
{{Cost|200|game=Splatoon 2}}
</noinclude>
</noinclude>

Revisión del 18:39 20 feb 2018

Displays an inline currency icon with a text link.

Usage

{{Cost|<game>|<price>|<currency>|<size>|<link>|<textwidth>}}

game Unnamed, required The game that the cost belongs to. Must be one of the following:
  • S for Splatoon
  • S2 for Splatoon 2
price Unnamed, required The number / string to show as the cost.
If set empty, the template will show the icon but no number.
Use 0 or Free for free items.
currency Unnamed, optional The currency to use.
The default value is cash.
Must be one of the following: S S2
cash Plantilla:Cost Plantilla:Cost
pe Plantilla:Cost Plantilla:Cost
sss Plantilla:Cost Plantilla:Cost
ge Plantilla:Cost
sard Plantilla:Cost
ac Plantilla:Cost
size Unnamed, optional The icon size for the currency icon. The default is 24.
link Unnamed, optional If present, the amount text will be a link to the currency's page.
textwidth Unnamed, optional Requries size and link to both be present.
If specified, the label will be set inside a right-aligned rectangle of the specified width

Markup

*{{Cost|S|200}}
*{{Cost|S2|200}}
*{{Cost|S|}}
*{{Cost|S|1|sss}}
*{{Cost|S2| |ac}}
*{{Cost|S|200|cash|48}}
*{{Cost|S|200|cash|link}}
*{{Cost|S|200|cash|48|link}}
*{{Cost|S|200|cash|24|link|60}}
*{{Cost|S|200|cash|24| |60}}

Output