Difference between revisions of "Template:Block list/header"

From Space Engineers Wiki
Jump to: navigation, search
m (fixed if-statement)
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{| class="wikitable sortable"
 
<includeonly>{| class="wikitable sortable"
 
|-
 
|-
! {{#if: {{{userparam|}}}|<!--
+
{{#if: {{{userparam|}}} |! {{#explode:{{{userparam}}}|;|0}}<!--
-->{{#vardefine:title|{{#explode:{{{userparam}}}|;|0}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|2}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop0|{{#explode:{{{userparam}}}|;|2}}}}<!-- part 1 is for icon size
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|3}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop1|{{#explode:{{{userparam}}}|;|3}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|4}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop2|{{#explode:{{{userparam}}}|;|4}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|5}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop3|{{#explode:{{{userparam}}}|;|5}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|6}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop4|{{#explode:{{{userparam}}}|;|6}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|7}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop5|{{#explode:{{{userparam}}}|;|7}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|8}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop6|{{#explode:{{{userparam}}}|;|8}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|9}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop7|{{#explode:{{{userparam}}}|;|9}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|10}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop8|{{#explode:{{{userparam}}}|;|10}}}}<!--
+
-->{{#if:{{#vardefineecho:PROP|{{#explode:{{{userparam}}}|;|11}}}}| !! {{translate|Property:{{#ifeq:{{#vardefineecho:PROPUNIT|{{#rpos:{{#var:PROP}}|#}}}}|-1|{{#var:PROP}}|{{#sub:{{#var:PROP}}|0|{{#var:PROPUNIT}}}}}}}}}}<!--
-->{{#vardefine:prop9|{{#explode:{{{userparam}}}|;|11}}}}<!--
+
-->|! {{Component list/Name{{lang}}}} !! {{Component list/Icon{{lang}}}} !! {{Component list/Mass (kg){{lang}}}} !! {{Component list/Description{{lang}}}}<!--
-->{{#var:title|Block}}<!--
+
-->}}
-->{{#if: {{#var:prop0}}| !! {{translate|Property:{{#var:prop0}}}}}}<!--
+
|-
-->{{#if: {{#var:prop1}}| !! {{translate|Property:{{#var:prop1}}}}}}<!--
+
</includeonly><noinclude>
-->{{#if: {{#var:prop2}}| !! {{translate|Property:{{#var:prop2}}}}}}<!--
 
-->{{#if: {{#var:prop3}}| !! {{translate|Property:{{#var:prop3}}}}}}<!--
 
-->{{#if: {{#var:prop4}}| !! {{translate|Property:{{#var:prop4}}}}}}<!--
 
-->{{#if: {{#var:prop5}}| !! {{translate|Property:{{#var:prop5}}}}}}<!--
 
-->{{#if: {{#var:prop6}}| !! {{translate|Property:{{#var:prop6}}}}}}<!--
 
-->{{#if: {{#var:prop7}}| !! {{translate|Property:{{#var:prop7}}}}}}<!--
 
-->{{#if: {{#var:prop8}}| !! {{translate|Property:{{#var:prop8}}}}}}<!--
 
-->{{#if: {{#var:prop9}}| !! {{translate|Property:{{#var:prop9}}}}}}<!--
 
-->|{{Component list/Name{{lang}}}} !! {{Component list/Icon{{lang}}}} !! {{Component list/Mass (kg){{lang}}}} !! {{Component list/Description{{lang}}}}<!--
 
-->}}</includeonly><noinclude>
 
 
Block list header template, for use in <code>#ask</code> queries.
 
Block list header template, for use in <code>#ask</code> queries.
  
Line 48: Line 38:
 
''note: icon-size is not used in this header template.''
 
''note: icon-size is not used in this header template.''
  
[[Category:Templates]]
+
[[Category:Templates]]</noinclude>
</noinclude>
 

Latest revision as of 16:36, 24 April 2020

Block list header template, for use in #ask queries.

Defaults to this for backwards compatibility:

Name Icon Mass (kg) Description

If |userparam= is defined in the query, the headers will be picked by each property's Property:Translation.

userparam
First column's title;icon-size;property1;property2;property3...
Example usage
Armor Block;64px;Mass;Integrity;IsAirTight;DeformationRatio
Armor Block Mass Integrity Is Airtight Deformation Ratio

note: icon-size is not used in this header template.