Difference between revisions of "Template:SimpleItembox/PropertyRow"
From Space Engineers Wiki
Vox Serico (talk | contribs) m (A missing property translation now results in a link to that property's page instead of a long message.) |
Vox Serico (talk | contribs) (Changed parameters to allow for #printout units in the 1st parameter, thus reducing SimpleItembox call size) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
--><div style="display: flex; justify-content: space-between; padding: 0 0.25em;{{#if:{{{color|}}}|background-color: {{{color}}};}}"><!-- | --><div style="display: flex; justify-content: space-between; padding: 0 0.25em;{{#if:{{{color|}}}|background-color: {{{color}}};}}"><!-- | ||
− | -- | + | -->{{#vardefine:PROPERTY|{{#ifexpr:{{#vardefineecho:UNITPOS|{{#rpos:{{{2}}}|#}}}} = -1<!-- |
+ | -->|{{{2}}}{{#vardefine:UNIT|}}<!-- | ||
+ | -->|{{#sub:{{{2}}}|0|{{#var:UNITPOS}}}}{{#vardefine:UNIT|{{#sub:{{{2}}}|{{#var:UNITPOS}}}}}}<!-- | ||
+ | -->}}}}<!-- | ||
+ | --><span>{{translate|Property:{{#var:PROPERTY}}}}</span><!-- | ||
--><span><!-- | --><span><!-- | ||
− | -->{{#ifeq:{{#show:Property:{{ | + | -->{{#ifeq:{{#show:Property:{{#var:PROPERTY}}|?Has type#-}} | Text<!-- |
− | + | -->| {{#ifexist:Property:{{#var:PROPERTY}}/{{#vardefineecho:VALUE|{{#show: {{{1}}}|?{{#var:PROPERTY}}}}}}<!-- | |
− | + | -->| {{translate|Property:{{#var:PROPERTY}}/{{#var:VALUE}}}}<!-- | |
− | + | -->| {{#show: {{{1}}}|?{{#var:PROPERTY}}}}<!-- | |
− | + | -->}}<!-- | |
+ | -->| {{#show: {{{1}}}|?{{{2}}}{{#if:{{{3|}}}|#{{{3}}}|{{#var:UNIT}}}}}}}}<!-- | ||
--></span><!-- | --></span><!-- | ||
--></div><!-- | --></div><!-- | ||
Line 15: | Line 20: | ||
Example: <code><nowiki>{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass}}</nowiki></code> | Example: <code><nowiki>{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass}}</nowiki></code> | ||
Result: <div style="max-width: 320px">{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass}}</div> | Result: <div style="max-width: 320px">{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass}}</div> | ||
− | + | ---- | |
− | |||
Example with unit conversion: <code><nowiki>{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass|g}}</nowiki></code> | Example with unit conversion: <code><nowiki>{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass|g}}</nowiki></code> | ||
Result: <div style="max-width: 320px">{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass|g}}</div> | Result: <div style="max-width: 320px">{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass|g}}</div> | ||
− | + | ---- | |
+ | Example 2 with unit conversion: <code><nowiki>{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass#g}}</nowiki></code> | ||
+ | Result: <div style="max-width: 320px">{{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass#g}}</div> | ||
+ | ---- | ||
+ | [[Category:Templates]] | ||
</noinclude> | </noinclude> |
Revision as of 02:55, 5 May 2020
{{SimpleItembox/PropertyRow|Page|Property|Unit}}
Example: {{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass}}
Mass109.8 kg
109,800 g
109,800,000 mg
0.11 t
109,800,000 mg
0.11 t
Example with unit conversion: {{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass|g}}
Mass109,800 g
109.8 kg
109,800,000 mg
0.11 t
109,800,000 mg
0.11 t
Example 2 with unit conversion: {{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass#g}}
Mass109,800 g
109.8 kg
109,800,000 mg
0.11 t
109,800,000 mg
0.11 t