Difference between revisions of "Template:SimpleItembox/PropertyRow"

From Space Engineers Wiki
Jump to: navigation, search
m
(Added special case for properties of Page type)
Line 7: Line 7:
 
     --><span>{{translate|Property:{{#var:PROPERTY}}}}</span><!--
 
     --><span>{{translate|Property:{{#var:PROPERTY}}}}</span><!--
 
     --><span><!--
 
     --><span><!--
       -->{{#ifeq:{{#show:Property:{{#var:PROPERTY}}|?Has type#-}} | Text<!--
+
       -->{{#switch:{{#show:Property:{{#var:PROPERTY}}|?Has type#-}}<!--
         -->| {{#ifexist:Property:{{#var:PROPERTY}}/{{#vardefineecho:VALUE|{{#show: {{{1}}}|?{{#var:PROPERTY}}}}}}<!--
+
         -->|Text={{#ifexist:Property:{{#var:PROPERTY}}/{{#vardefineecho:VALUE|{{#show: {{{1}}}|?{{#var:PROPERTY}}}}}}<!--
 
           -->| {{translate|Property:{{#var:PROPERTY}}/{{#var:VALUE}}}}<!--
 
           -->| {{translate|Property:{{#var:PROPERTY}}/{{#var:VALUE}}}}<!--
           -->| {{#show: {{{1}}}|?{{#var:PROPERTY}}}}<!--
+
           -->| {{#var:VALUE}}<!--
 
         -->}}<!--
 
         -->}}<!--
      -->| {{#show: {{{1}}}|?{{#var:PROPERTY}}{{#if:{{{3|}}}|#{{{3}}}|{{#var:UNIT}}}}}}}}<!--
+
        -->|Page={{#if: {{#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><!--
 
     --></span><!--
 
   --></div><!--
 
   --></div><!--
Line 21: Line 26:
 
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>
+
(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>
 
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>
+
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>
 
----
 
----
 
[[Category:Templates]]
 
[[Category:Templates]]
 
</noinclude>
 
</noinclude>

Revision as of 17:12, 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