Difference between revisions of "Template:SimpleItembox/PropertyRow"

From Space Engineers Wiki
Jump to: navigation, search
m (Colon after property name)
m
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly><!--
 
<includeonly><!--
   --><div style="display: flex; justify-content: space-between;"><!--
+
   --><div style="display: flex; justify-content: space-between; padding: 0 0.25em;{{#if:{{{color|}}}|background-color: {{{color}}};}}"><!--
     --><span>{{translate|Property:{{{2}}}}}:</span><!--
+
     -->{{#vardefine:PROPERTY|{{#ifexpr:{{#vardefineecho:UNITPOS|{{#rpos:{{{2}}}|#}}}} = -1<!--
     --><span>{{#show: {{{1}}}|?{{{2}}}}}</span><!--
+
      -->|{{{2}}}{{#vardefine:UNIT|}}<!--
 +
      -->|{{#sub:{{{2}}}|0|{{#var:UNITPOS}}}}{{#vardefine:UNIT|{{#sub:{{{2}}}|{{#var:UNITPOS}}}}}}<!--
 +
    -->}}}}<!--
 +
    --><span>{{translate|Property:{{#var:PROPERTY}}}}</span><!--
 +
     --><span><!--
 +
      -->{{#switch:{{#show:Property:{{#var:PROPERTY}}|?Has type#-}}<!--
 +
        -->|Text={{#ifexist:Property:{{#var:PROPERTY}}/{{#vardefineecho:VALUE|{{#show: {{{1}}}|?{{#var:PROPERTY}}}}}}<!--
 +
          -->| {{translate|Property:{{#var:PROPERTY}}/{{#var:VALUE}}}}<!--
 +
          -->| {{#var:VALUE}}<!--
 +
        -->}}<!--
 +
        -->|Page={{#if: {{#show:{{#show:{{{1}}}|?{{#var:PROPERTY}}#-}}|?TypeId}}<!--
 +
          -->|{{icon|{{#vardefineecho:VALUE|{{#show: {{{1}}}|?{{#var:PROPERTY}}#-}}}}|tiny}}&nbsp;[[{{#show:{{#var:VALUE}}|?Main_article#-}}{{lang}}|{{Translate|{{#var:VALUE}}}}]]<!--
 +
          -->|{{Translate|{{#show: {{{1}}}|?{{#var:PROPERTY}}#-}}}}<!--
 +
        -->}}<!--
 +
        -->|#default={{#show: {{{1}}}|?{{#var:PROPERTY}}{{#if:{{{3|}}}|#{{{3}}}|{{#var:UNIT}}}}}}<!--
 +
      -->}}<!--
 +
    --></span><!--
 
   --></div><!--
 
   --></div><!--
--></includeonly><noinclude>
+
--></includeonly><noinclude><!--
 
 
{{Under Construction}}
 
<pre>{{SimpleItembox/PropertyRow|Page|Property}}</pre>
 
 
 
Example: <code><nowiki>{{SimpleItembox/PropertyRow|SmallHydrogenTankSmall|Mass}}</nowiki></code>
 
Result: <div style="max-width: 320px">{{SimpleItembox/PropertyRow|SmallHydrogenTankSmall|Mass}}</div>
 
  
 +
--><pre>{{SimpleItembox/PropertyRow|Page|Property|Unit}}</pre>
 +
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>
 +
----
 +
(Obsolete) 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>
 +
----
 +
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>
 +
----
 +
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 21:56, 20 May 2020

{{SimpleItembox/PropertyRow|Page|Property|Unit}}

Example: {{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass}}

Result:
Mass109.8 kg
109,800 g
109,800,000 mg
0.11 t

(Obsolete) example with unit conversion: {{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass|g}}

Result:
Mass109,800 g
109.8 kg
109,800,000 mg
0.11 t

Example with unit conversion: {{SimpleItembox/PropertyRow|Mod:Vanilla/CubeBlock/SmallHydrogenTankSmall|Mass#g}}

Result:
Mass109,800 g
109.8 kg
109,800,000 mg
0.11 t