Kerbal Space Program Wiki:Templates

From Kerbal Space Program Wiki
Revision as of 02:29, 25 December 2014 by XZise (talk | contribs) (Data template for celestial bodies: *well the original text would've explained it;)
Jump to: navigation, search
This article is a stub. You can help KSP Wiki by expanding it.

Data templates

Language-independent information should be stored in a specific template (a “data template“), to be referred to by each localized template (e.g. English, French, etc). This avoids duplicating data in different pages and improves maintainability and stability. Such templates should use {{Data template used}}, which will categorize them in Category:Translating templates.

Data templates for parts

For instance, Rockomax 48-7S (English), Rockomax 48-7S/pl (Polish) and Rockomax 48-7S/ja (Japanese) all use the same raw data stored in the data template Rockomax 48-7S/Box to draw the infobox on the right. To do so, they simply include {{:Rockomax 48-7S/Box}}. Mind the colon (":").

Rockomax 48-7S/Box itself includes {{Infobox/Part}}, which defines how the infobox is to be drawn and how to translate it.

Data template for celestial bodies

The infobox for celestial body works a little different. Instead of having the complete infobox in an seperate article like Rockomax 48-7S/Box it only has the values stored in a page like Kerbin/Param. The template then automatically gets the value from that page so in a page like Kerbin only {{Infobox/Body}} is required.

Not all pages already uses this system and still look like they use a similar system to the part infoboxes but in Kerbin/Data instead of Kerbin/Box. But this is just because those pages haven't been updated: The infobox is not using the values given in the data template (changing values there won't change how it appears) but like in the English page is using those from Kerbin/Param.