Template:Infobox part: Difference between revisions

From Kerbal Space Program 2 Wiki
Jump to navigation Jump to search
Started page for a part infobox parent template
Tag: 2017 source edit
 
Undo revision 8999 by KiwiShark (talk)
Tag: Undo
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
<templatedata>
{{Documentation}}
{
</noinclude><includeonly>{{Infobox
"params": {
| name    = {{PAGENAME}}
"image": {
| title    = {{PAGENAME}}
"aliases": [
| image   = [[File:{{#invoke:Data|getData|{{PAGENAME}}|file}}|200px|center]]
"picture",
| caption = {{#invoke:Data|getData|{{PAGENAME}}|subtitle}}
"thumbnail"
| below    = {{#invoke:Data|getData|{{PAGENAME}}|manufacturer}}
],
"label": "Part Image",
"description": "The filename of the part, including the file extension",
"example": "LV-3000_Tuba.png",
"type": "wiki-file-name",
"required": true
},
"caption": {
"aliases": [
"subtitle"
],
"label": "Caption",
"description": "The part's classification per the in-game description.",
"example": "Deep Space Methalox Engine",
"type": "string",
"required": true
},
"size": {
"label": "Size",
"description": "Size of part (using {{Size}})",
"type": "string",
"required": true,
"suggestedvalues": [
"XS",
"SM",
"MD",
"LG",
"XL",
"2X"
]
},
"max temp": {
"label": "Max Temperature (K)",
"description": "Maximum withstandable temperature",
"type": "string",
"required": true
},
"impact tol": {
"label": "Impact Tolerance (m/s)",
"description": "Impact Tolerance (m/s)",
"type": "string",
"required": true
},
"mass": {
"label": "Mass (t)",
"description": "Mass (t)",
"type": "string",
"required": true
},
"manufacturer": {
"aliases": [
"maker",
"brand"
],
"label": "Manufacturer",
"description": "The in-game manufacturer of the part.",
"example": "Jebediah's Junkyard",
"type": "string",
"required": true
},
"part type subbox": {
"label": "Part Type Data",
"description": "Enter data for the part's type if applicable.",
"example": "Command Module, Engine, Fuel Tank, etc.",
"type": "wiki-template-name",
"suggested": true
}
},
"description": "Generate an infobox for a part.",
"paramOrder": [
"image",
"caption",
"mass",
"size",
"max temp",
"impact tol",
"manufacturer",
"part type subbox"
]
}
</templatedata>


{{Infobox
| labelstyle  = width: 50%; text-align: left;
| name    = Test
| titlestyle =  
| title    = Test box
padding: 0.2em 0em 0.2em;
| image    = [[File:SWERV.png|200px]]
font-size: 22px;
| caption = Test caption
font-weight: bold;
| bodystyle  = width: 23em;
    border: 1px solid #a2a9b1;
    border-spacing: 3px;
    margin: 0.5em 0 0.5em 1em;
    padding: 0.2em;
    float: right;
    clear: right;
    font-size: 12px;
    line-height: 1.5em;
| headerstyle  = font-weight: bold;
    font-size: 16px;
    text-align: left;
    padding-top: 0.5em
| autoheaders = y
| captionstyle = text-align: center; font-style: italic;
| header10  = Statistics


| labelstyle  = width: 33%
| label11  = Mass
| bodystyle   = width: 20em
| data11   = {{#invoke:Data|getData|{{PAGENAME}}|mass}} <small>t</small>
| headerstyle  = font-weight: bold; color: black; background: #f7aa33;


| header1  = Statistics
| label12   = Size
| label2   = Mass (t)
data12   = {{Size|Size={{#invoke:Data|getData|{{PAGENAME}}|size}}}}
data2   = #
| label3  = Size
|  data3  = #
| label4  = Max Temp (K)
| data4  = {{{max temp|#}}}
| label5  = Impact Tolerance (m/s)
|  data5  = {{{impact tol|#}}}


| header6 = Part Type Subbox
| label13  = Max Temp
| below    = Jedediah's Junk Yard
| data13  = {{#invoke:Data|getData|{{PAGENAME}}|max_temp}} <small>K</small>


}}
| label14  = Impact Tolerance
</noinclude>
|  data14  = {{#invoke:Data|getData|{{PAGENAME}}|imp_tol}} <small>m/s</small>


<includeonly>
| label20  = Methalox
{{Infobox
|  data20  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|resources|methalox}} | {{#invoke:Data|getData|{{PAGENAME}}|resources|methalox}} <small>t</small>}}
| name    = {{PAGENAME}}
 
| title    = {{PAGENAME}}
| label21  = Methane
| image    = [[File:{{{image|}}}|200px]]
|  data21  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|resources|methane}} | {{#invoke:Data|getData|{{PAGENAME}}|resources|methane}} <small>t</small>}}
| caption = {{{caption|}}}
 
| label22  = Monopropellant
|  data22  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|resources|monopropellant}} | {{#invoke:Data|getData|{{PAGENAME}}|resources|monopropellant}} <small>t</small>}}
 
| label23  = Solid Fuel
|  data23  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|resources|solid_fuel}} | {{#invoke:Data|getData|{{PAGENAME}}|resources|solid_fuel}} <small>t</small>}}
 
| label24  = Hydrogen
|  data24  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|resources|hydrogen}} | {{#invoke:Data|getData|{{PAGENAME}}|resources|hydrogen}} <small>t</small>}}
 
| label25  = Xenon
|  data25  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|resources|xenon}} | {{#invoke:Data|getData|{{PAGENAME}}|resources|xenon}} <small>t</small>}}
 
| label26  = Electric Charge (U)
|  data26  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|resources|electric_charge}} | {{#invoke:Data|getData|{{PAGENAME}}|resources|electric_charge}} <small>U</small>}}
 
| label29  = Stores Research
|  data29  = {{#ifeq: {{#invoke:Data|getData|{{PAGENAME}}|stores_research}} | true | ✔ |}}
 
| header30 = Engine
| data31 = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|engine}} | {{Infobox engines}} |}}
 
| header32 = Engine Gimbal
| data33 = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|engine_gimbal}} | {{Infobox engine gimbal}} |}}
 
| header34 = Generator
| data35 = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|generator}} | {{Infobox generator}} |}}
 
| header36 = Command Module
| data37  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|command_module}} | {{Infobox command module}} |}}
 
| header38 = Reaction Wheel
| data39  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|reaction_wheel}} | {{Infobox reaction wheel}} |}}
 
| header40 = Data Transmitter
| data41  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|data_transmitter}} | {{Infobox data transmitter}} |}}


| labelstyle  = width: 33%
| header42 = Light
| bodystyle   = width: 20em
| data43   = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|light}} | {{Infobox light}} |}}
| headerstyle  = font-weight: bold; color: black; background: #f7aa33;


| header1  = Statistics
| header50 = Converter
| data51  = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|converter}} | {{Infobox converter}} |}}


| label2  = Mass (t)
| header80 = Parachute
| data2  = {{{mass|}}}
| data81 = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|parachute}} | {{Infobox parachute}} |}}
| label3  = Size
| data3  = {{Size|Size={{{size|}}}|Add Category=1}}
| label4  = Max Temp (K)
|  data4  = {{{max temp|}}}
| label5  = Impact Tolerance (m/s)
|  data5  = {{{impact tol|}}}


| header6 = {{{part type subbox|}}}
| header120 = Science Experiment
| below  = {{{manufacturer|}}}
| data121 = {{#if: {{#invoke:Data|getData|{{PAGENAME}}|modules|science_experiment}} | {{Infobox science experiment}} |}}


}}
}}</includeonly>
</includeonly>

Latest revision as of 05:01, 27 March 2025