Difference between revisions of "Template:Body data"

From Kerbal Space Program Wiki
Jump to: navigation, search
(+support template;)
(*rewritten the documentation;)
Line 1: Line 1:
 
<includeonly>{{{{#ifeq: {{{1}}}|Infobox|Template}}:{{{1}}}/Param|{{{2}}}}}</includeonly><noinclude>
 
<includeonly>{{{{#ifeq: {{{1}}}|Infobox|Template}}:{{{1}}}/Param|{{{2}}}}}</includeonly><noinclude>
{{Box|type=warning|This template and {{Tl|Infobox/Body}} are under heavy development at the moment. Expect problems with display of automatically generated numbers in tables for the next hours until it is sorted out. Don't make adjustments unless you really know what to do!}}
+
Returns for each [[celestial body]] various data about it. It extracts the value from the page named “<body>/Param” (e.g. [[Duna/Param]]) which needs to exists for this template to work. There is also a [[Template:Infobox/Param]] which is used by {{Tl|Infobox/Body}}.
Returns for each [[celestial body]] various data about it.
 
  
 
{{Parameter Table|parameters=
 
{{Parameter Table|parameters=
Line 41: Line 40:
  
 
Parents which are indented don't need to be set, when the previous non-indented parameter isn't set.
 
Parents which are indented don't need to be set, when the previous non-indented parameter isn't set.
 
For backwards compatibility this template also supports the following properties. It simply calls the appropriate subtemplate. They additionally support Sun and Mün instead of Kerbol and Mun.
 
* <tt>apoapsis</tt>: {{Tl|BodyData/Apoapsis}}
 
* <tt>periapsis</tt>: {{Tl|BodyData/Periapsis}}
 
* <tt>parent</tt>: {{Tl|BodyData/Parent}}
 
* <tt>radius</tt>: {{Tl|BodyData/Radius}}
 
* <tt>mass</tt>: {{Tl|BodyData/Mass}}
 
* <tt>pressure</tt>: {{Tl|BodyData/Pressure}} (returns the pressure at 0 m altitude (“sea level”))
 
* <tt>scale height</tt>: {{Tl|BodyData/ScaleHeight}}
 
'''The direct usage of those subtemplates is not recommended anymore!'''
 
 
This template don't support math templates directly as parameters like <tt><nowiki>{{BodyData|Kerbin|soi}}</nowiki></tt>.
 
  
 
== Separate subtemplates ==
 
== Separate subtemplates ==
Some special properties can be accessed via a separate sub template
+
Some special properties can be accessed via a separate sub template. These templates can't be called with the property set like <tt><nowiki>{{BodyData|Kerbin|soi}}</nowiki></tt>.
 
* Name: {{Tl|BodyData/Name}}
 
* Name: {{Tl|BodyData/Name}}
 
* Surface gravity: {{Tl|BodyData/Gravity}}
 
* Surface gravity: {{Tl|BodyData/Gravity}}

Revision as of 15:42, 14 September 2013

Returns for each celestial body various data about it. It extracts the value from the page named “<body>/Param” (e.g. Duna/Param) which needs to exists for this template to work. There is also a Template:Infobox/Param which is used by {{Infobox/Body}}.

Template:Parameter Table

Properties

The following properties are supported: Template:Parameter Table

There are the following classes available:

Parents which are indented don't need to be set, when the previous non-indented parameter isn't set.

Separate subtemplates

Some special properties can be accessed via a separate sub template. These templates can't be called with the property set like {{BodyData|Kerbin|soi}}.