Difference between revisions of "Template:Infobox/Part"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (Removed the Manufacturer due to formatting issues.)
(*add new partbox system with multiple subtemplates;)
Line 1: Line 1:
{| border="0" style="padding: 0 10px; float:right; width:200px; border: 1px solid #ccc; background-color:#f6f6f6; margin-left: 1em"
+
<includeonly>{| style="padding: 0.5em; font-size: 90%; background: #f6f6f6; border: 1px solid #ccc; float: right; width: 200px; margin-left: 1em"
! colspan="2" | {{{Name|{{PAGENAME}}}}}
 
 
|-
 
|-
| colspan="2" style="text-align: center;" | ''{{{Role|??}}}'' <small>([[API:{{{Class|??}}}|{{{Class|??}}}]])</small>
+
| colspan="2" style="background: #ccc;  padding: .5em; text-align: center; font-size: large; font-weight: bold;" | {{#if: {{{Name|}}}|{{{Name}}}|{{BASEPAGENAME}}}}
 
|-
 
|-
| colspan="2" style="text-align: center;" | [[File:{{{File|Image-needed.png}}}|180px|Part image]]
+
| colspan="2" | [[File:{{#if: {{{File|}}}|{{{File}}}|Image-needed.png}}|200px|Part image]]
|-valign="top"
+
|-
| Cost || {{{Costs|??}}}
+
| colspan="2" style="text-align: center;" | '''{{{Role}}}''' <span style="font-size:smaller;">{{#if: {{{Manufacturer|}}}|by <span style="white-space:nowrap;">''{{{Manufacturer}}}''</span>}}</span>
|-valign="top"
+
{{#if: {{{size|}}}|{{PB-more|{{lang|en=Radial size|ru=Размер|pl=Rozmiar}}|{{Radial Size|{{{size}}}}}{{#if: {{{size2|}}}|, {{Radial Size|{{{size2}}}}}}}}}}}
| Total Mass || {{{Mass|??}}} t
+
|- valign="top"
|-valign="top"
+
| {{lang|en=Cost|ru=Цена|pl=Cena}}
| Drag || {{{Drag|??}}}  
+
| {{{Costs}}}
|-valign="top"
+
|- valign="top"
| Max Temp. || {{{Temp|??}}}  
+
| {{lang|en=Total Mass|ru=Масса|pl=Masa całkowita}}
|-valign="top"
+
| {{{Mass}}} t
| Impact Tolerance || {{{Tolerance|??}}}  
+
|- valign="top"
 +
| {{lang|en=Drag|ru=Лобовое сопротивление|pl=Opór}}
 +
| {{{Drag}}}  
 +
|- valign="top"
 +
| {{lang|en=Max Temp.|ru=максимальная температура|pl=Maks. Temp.}}
 +
| {{{Temp}}}  
 +
|- valign="top"
 +
| {{lang|en=Impact Tolerance|ru=целостность конструкции|pl=Tolerancja}}
 +
| {{{Tolerance}}} m/s
 
{{{More|}}}
 
{{{More|}}}
|-valign="top"
+
|- valign="top"
| Since Version || {{#if: {{{since|}}}|[[Version History#{{{since}}}|{{{since}}}]]|??}}
+
| {{lang|en=Since Version|pl=Od wersji}}
 +
| {{#if: {{{since|}}}|{{version|{{{since}}}|}}|{{lang|en=Unknown}}}}
 
|-
 
|-
| colspan="2" style="text-align: center;" | <small>[[{{{cfg}}}|view part.cfg]]</small>
+
| colspan="2" style="text-align: center;" | <small>{{#if: {{{Class|}}}|[[API:{{{Class}}}|{{{Class}}}]]|Unknown API}}&nbsp;·&nbsp;{{#if: {{{part|}}}|[[Parts/{{{part}}}/part.cfg|part.cfg]]|{{#if: {{{cfg|}}}|[[{{{cfg}}}|part.cfg]]|Unknown cfg}}}}
|}<includeonly>[[Category:{{{Role}}}]]</includeonly><noinclude>
+
|}</includeonly><noinclude>{{Box|notice.svg|'''This article is currently undergoing a major expansion or revamping.''' While the transition is in progress there could be inconsistencies.|#aaaaff|}}{{Template:Partbox
<br clear="both" />
+
|Name=TVR-1180C Mk1 Stack Tri-Coupler
 +
|Role=Adapter
 +
|size=small
 +
|Class=
 +
|File=Tvr-1180C_mk1_stack_tri-coupler.jpg
 +
|Costs=680
 +
|Mass=0.3
 +
|Drag=0.3
 +
|Temp=3400
 +
|Tolerance=12
 +
|Manufacturer=Found lying by the side of the road
 +
|since=0.7.3
 +
|part=stackTriCoupler
 +
}}
 +
 
 +
== Parameters ==
 +
{{Template:Partbox/Parameters}}
 +
 
 +
For compatibility it supports the {{{cfg}}} parameter but should be replaced by the {{{part}}} parameter.
 +
 
 +
=== More Parameter ===
 +
To add additional fields the more {{{More}}} parameter should be used with {{Tl|PB-more}}.
 +
 
 +
== Roles ==
 +
For different roles with special additional parameters one of the following templates should be used:
 +
* [[Parts#Pods|Command pods]]: {{Tl|Partbox/CommandPod}}
 +
* [[Parts#Liquid_Fuel_Engines|Liquid fuel engines]]: {{Tl|Partbox/LiquidFuelEngine}}
 +
* [[Parts#Jet_Engines|Jet engines]]: {{Tl|Partbox/JetEngine}}
 +
* [[Parts#Solid_Fuel_Boosters|Solid Fuel Boosters]]: {{Tl|Partbox/SolidFuelBoosters}}
 +
* [[Parts#Liquid_Fuel_Tanks|Liquid Fuel Tanks]] and [[Parts#Fuselages (Jet Fuel Tanks)|Jet Fuel Tanks]]: {{Tl|Partbox/FuelTanks}}
 +
* [[Parts#RCS_Fuel_Tanks|RCS Fuel Tanks]]: {{Tl|Partbox/RCSFuelTank}}
 +
* [[Parts#S.A.S.|SAS]]: {{Tl|Partbox/SAS}}
 +
* [[Parts#RCS|RCS thrusters]]: {{Tl|Partbox/RCSModule}}
 +
* [[Parts#Decouplers_and_Separators|Decouplers]]: {{Tl|Partbox/Decoupler}}
 +
* [[Parts#Rover_Wheels|Rover wheels]]: {{Tl|Partbox/RoverWheels}}
 +
* More are following…
 +
 
 +
Those templates don't support the {{{cfg}}} parameter!
 +
 
 
== Template ==
 
== Template ==
<pre><nowiki>{{Partbox
+
<pre>{{Partbox
 
|Name=
 
|Name=
 
|Role=
 
|Role=
 +
|Class=
 
|File=
 
|File=
 +
|size=
 +
|size2=
 
|Costs=
 
|Costs=
|Manufacturer=
 
 
|Mass=
 
|Mass=
 
|Drag=
 
|Drag=
 
|Temp=
 
|Temp=
 
|Tolerance=
 
|Tolerance=
 +
|Manufacturer=
 
|More=
 
|More=
 
|since=
 
|since=
|cfg=
+
|part=
 +
}}</pre>
 +
 
 +
== Example ==
 +
Example used on this page:
 +
<pre>{{Template:Partbox
 +
|Name=TVR-1180C Mk1 Stack Tri-Coupler
 +
|Role=Adapter
 
|Class=
 
|Class=
}}</nowiki></pre>
+
|File=Tvr-1180C_mk1_stack_tri-coupler.jpg
 
+
|size=small
== Usage ==
+
|Costs=680
This templates takes the following arguments:
+
|Mass=0.3
 
+
|Drag=0.3
{| class="wikitable"
+
|Temp=3400
|-
+
|Tolerance=12
! Argument !! Explanation !! Example !! mandatory?
+
|Manufacturer=Found lying by the side of the road
|-
+
|since=0.7.3
| Name || Name of the part. Defaults to ''<nowiki>{{PAGENAME}}</nowiki>'' || FL-T500 Fuel Tank || no
+
|part=stackTriCoupler
|-
+
}}</pre>
| Role || Role the part fulfills || Fuel Tank || '''yes'''
 
|-
 
| Class || The Part Module the part uses || FuelTank || '''yes'''
 
|-
 
| File || Name of the file to be displayed || FL-T500 Fuel Tank.jpg || '''yes'''
 
|-
 
| Costs || Costs of the part || 550 || '''yes'''
 
|-
 
| Mass || Mass of the part || 2.5 || '''yes'''
 
|-
 
| More || More module-specific information || (see below) || no
 
|-
 
| since || Version the part first appeared in || 0.7.3 || '''yes'''
 
|-
 
| cfg || Link to cfg-entry in wiki || Parts/FuelTank/parts.cfg || '''yes'''
 
|}
 
 
 
=== More fields ===
 
Many fields are module-specific. As it is difficult to use pipes '''|''' in templates, the template [[Template:PB-more]] is used. Refer to this example:
 
<pre><nowiki>
 
{{Partbox
 
|Name=FL-T500 Fuel Tank
 
|Role=Fuel Tank
 
|File=FL-T500 Fuel Tank.jpg
 
|Costs=550
 
|Mass=25
 
|More=
 
{{PB-more|Dry Mass|0.3 kg}}
 
{{PB-more|Fuel|500}}
 
|cfg=Parts/FuelTank/parts.cfg
 
|Class=FuelTank
 
}}
 
</nowiki></pre>
 
  
 
[[Category:Templates|Partbox]]
 
[[Category:Templates|Partbox]]
 
</noinclude>
 
</noinclude>

Revision as of 16:14, 11 April 2013

This article is currently undergoing a major expansion or revamping. While the transition is in progress there could be inconsistencies.
Template:Partbox

Parameters

Template:Partbox/Parameters

For compatibility it supports the {{{cfg}}} parameter but should be replaced by the {{{part}}} parameter.

More Parameter

To add additional fields the more {{{More}}} parameter should be used with {{PB-more}}.

Roles

For different roles with special additional parameters one of the following templates should be used:

Those templates don't support the {{{cfg}}} parameter!

Template

{{Partbox
|Name=
|Role=
|Class=
|File=
|size=
|size2=
|Costs=
|Mass=
|Drag=
|Temp=
|Tolerance=
|Manufacturer=
|More=
|since=
|part=
}}

Example

Example used on this page:

{{Template:Partbox
|Name=TVR-1180C Mk1 Stack Tri-Coupler
|Role=Adapter
|Class=
|File=Tvr-1180C_mk1_stack_tri-coupler.jpg
|size=small
|Costs=680
|Mass=0.3
|Drag=0.3
|Temp=3400
|Tolerance=12
|Manufacturer=Found lying by the side of the road
|since=0.7.3
|part=stackTriCoupler
}}