Template:Infobox engines: Difference between revisions

From Kerbal Space Program 2 Wiki
Jump to navigation Jump to search
Cleaned up param names, working on implementing header via template page sample
Tag: 2017 source edit
simplified formatting
 
(47 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
<templatedata>
{{Documentation}}
{
</noinclude><includeonly>
"params": {
{{Infobox | subbox = yes
"image": {},
| headerstyle  = font-weight: bold; font-size: 18px; text-align: left;
"caption": {},
| labelstyle  = width: 50%; text-align: left;
"size": {
| header20 = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|alt_mode}} | {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|mode_name}} |}}
"label": "Size",
| label21  = {{#invoke:Data infobox|getFuelLabels|{{PAGENAME}}}}
"description": "Size of part (using {{Size}})",
| data21  = {{#invoke:Data infobox|getFuelValues|{{PAGENAME}}}}
"type": "string",
  | label22   = Thrust: 1 atm. (kN)
"required": true,
data22   = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|max_thrust|atm}} <small>kN</small>
"suggestedvalues": [
| label23   = Thrust: Vac. (kN)
"XS",
data23   = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|max_thrust|vac}} <small>kN</small>
"SM",
| label24   = I<sub>sp</sub>: 1 atm. (s)
"MD",
data24  = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|isp|atm}} <small>s</small>
"LG",
| label25   = I<sub>sp</sub>: Vac. (s)
"XL",
data25  = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|isp|vac}} <small>s</small>
"2X"
}}
]
{{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|alt_mode}}
},
| {{Infobox | subbox = yes
"max temp": {
  | headerstyle  = font-weight: bold; font-size: 18px; text-align: left;
"label": "Max Temperature (K)",
  | labelstyle  = width: 50%; text-align: left;
"description": "Maximum withstandable engine temperature",
  | header20 = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|alt_mode|mode_name}}
"type": "string",
  | label21  = {{#invoke:Data infobox|getFuelLabels|{{PAGENAME}}|alt}}
"required": true
  | data21  = {{#invoke:Data infobox|getFuelValues|{{PAGENAME}}|alt}}
},
  | label22  = Thrust: 1 atm.
"impact tol": {
   |  data22   = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|max_thrust|atm}} <small>kN</small>
"label": "Impact Tolerance (m/s)",
  | label23   = Thrust: Vac.
"description": "Impact Tolerance (m/s)",
  data23   = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|max_thrust|vac}} <small>kN</small>
"type": "string",
  | label24   = I<sub>sp</sub>: 1 atm.
"required": true
  data24  = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|isp|atm}} <small>s</small>
},
  | label25   = I<sub>sp</sub>: Vac.
"mass": {
  data25  = {{#invoke:Data|getData|{{PAGENAME}}|modules|engine|isp|vac}} <small>s</small>
"label": "Mass (t)",
  }}
"description": "Mass (t)",
}}
"type": "string",
"required": true
}
},
"description": "Generate an infobox for an engine.",
"paramOrder": [
"image",
"caption",
"mass",
"size",
"max temp",
"impact tol"
]
}
</templatedata>
 
{{Infobox
| style = float: right;
| name    = Test
| title    = Test box
| image    = {{{image|}}}
| caption = Test caption
 
| header1 = Statistics
 
| label2   = Mass (t)
data2   = #
| label3   = Size
data3   = #
| label4   = Max Temp (K)
data4  = {{{max temp|#}}}
| label5   = Impact Tolerance (m/s)
data5  = {{{impact tol|#}}}
}}
</noinclude>
 
<includeonly>
{{Infobox
| name    = {{PAGENAME}}
| title    = {{PAGENAME}}
| image    = {{{image|}}}
| caption = {{{caption|}}}
 
| header  = Statistics
 
| label1   = Mass (t)
data1   = {{{mass|}}}
| label2   = Size
data2   = {{Size|Size={{{size|}}}|Add Category=1}}
| label3   = Max Temp (K)
data3  = {{{max temp|}}}
| label4   = Impact Tolerance (m/s)
data4  = {{{impact tol|}}}
}}
</includeonly>
</includeonly>

Latest revision as of 23:45, 28 January 2025