Vorlage:Qualityprice: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
K (handle empty params) |
(sync) |
||
Zeile 2: | Zeile 2: | ||
// Define letter/symbol used for gold in current language | // Define letter/symbol used for gold in current language | ||
− | -->{{#arraydefine:$lang_qp_gold| | + | -->{{#arraydefine:$lang_qp_gold|G}}<!-- |
// Items that get autofilled by Infobox and therefore need to be autotranslated to fill in link | // Items that get autofilled by Infobox and therefore need to be autotranslated to fill in link | ||
// (other items are tested below, but the tested values should be image names which are same on all sites) | // (other items are tested below, but the tested values should be image names which are same on all sites) | ||
Zeile 49: | Zeile 49: | ||
}}}} | }}}} | ||
|{{{2|0}}} | |{{{2|0}}} | ||
− | }}}}{{#arraydefine:$qplink|{{#if:{{{link|}}}|{{{link}}}|{{ParseInputValues|code=qitem|{{{1|}}}|translate=true}}}}}}<!-- | + | }}}}{{#arraydefine:$qplink|{{#ifeq:{{{link}}}|||{{#if:{{{link|}}}|{{{link}}}|{{ParseInputValues|code=qitem|{{{1|}}}|translate=true|default=true}}}}}}}}<!-- |
− | // | + | // Display sort key (0 for text/non-numeric price so it doesn't mess up table) |
− | -->{{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}} | + | --><span class="sortkey" style="display:none;">{{#iferror: |
− | + | {{#expr:{{#arrayprint:$qpprice}}>0}} | |
− | + | |0 | |
− | + | |{{#expr:trunc(({{#arrayprint:$qpmult}})*trunc({{#arrayprint:$qpprice}}))}}}}</span><!-- | |
− | {{{!}} class="no-wrap" style="border-spacing: 0;" | + | // Start table and loop through each requested quality |
− | + | // Display icon using Quality template and calculate/display price--> | |
− | + | {{{!}} class="no-wrap" style="border-spacing: 0;" | |
− | + | {{#arrayprint:$qpqual||@qual@|<nowiki/> | |
{{!}}- | {{!}}- | ||
− | {{!}} {{Quality|{{{1|}}}|@qual@| size={{#if:{{{size|}}}|{{{size}}}|24}} |link={{#arrayprint:$qplink}} |alt={{#if:{{{alt|}}}|{{{alt}}}|{{#if:{{#arrayprint:$qplink}}|{{#arrayprint:$qplink}}|{{{1|}}}}}}}}} | + | {{!}} {{Quality|{{{1|}}}|@qual@| size={{#if:{{{size|}}}|{{{size}}}|24}} |link={{#arrayprint:$qplink}} |alt={{#ifeq:{{{alt}}}|||{{#if:{{{alt|}}}|{{{alt}}}|{{#if:{{#arrayprint:$qplink}}|{{#arrayprint:$qplink}}|{{{1|}}}}}}}}}}} |
− | {{!}} {{formatnum:{{#expr: | + | {{!}} {{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}} |
− | + | |''{{{2|}}}'' | |
− | + | |{{formatnum:{{#expr: | |
− | + | trunc( ({{#arrayprint:$qpmult}}) * | |
− | + | trunc ( {{#switch:@qual@|Silver=1.25|Gold=1.5|Iridium=2|Normal|#default=1}} * | |
− | }} | + | trunc({{#arrayprint:$qpprice}}) ) ) |
+ | }}}}{{#arrayprint:$lang_qp_gold}} | ||
+ | }}}} | ||
{{!}}}<!-- | {{!}}}<!-- | ||
− | --> | + | --></includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> |
{{{{FULLPAGENAME}}/doc}} }}</noinclude> | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |
Version vom 24. September 2020, 21:40 Uhr
Details zur Vorlage finden Sie auf der englischsprachigen Dokumentationsseite.
Verwendung
Diese Vorlage kann verwendet werden, indem Sie auf eine relevante Seite folgendes eingeben.
{{Qualityprice}}
Ergibt... Vorlage:ParseInputValues
0G |