Difference between revisions of "Kerbal Space Program Wiki:Templates"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Data templates: *update to the newest developments;)
m (Data templates: -random case;)
Line 2: Line 2:
  
 
== Data templates ==
 
== Data templates ==
Templates with most of it data which doesn't need to be translated can use a special system of storing the values in another template itself. This helps other languages to reuse these values directly and is used for example by all celestial objects with {{Tl|Infobox/Body}}. Because every article can be included via templates it is possible to add an article other articles. Templates which are in the [[:Category:Translating Templates]] could be used for this method. It uses a subpage of the article in which the content/values are stored and the article with all the translation then imports this subpage.
+
Templates with most of it data which doesn't need to be translated can use a special system of storing the values in another template itself. This helps other languages to reuse these values directly and is used for example by all celestial objects with {{Tl|Infobox/Body}}. Because every article can be included via templates it is possible to add an article other articles. Templates which are in the [[:Category:Translating templates]] could be used for this method. It uses a subpage of the article in which the content/values are stored and the article with all the translation then imports this subpage.
  
 
For example the <nowiki>{{Infobox/Part}}</nowiki> template suggests to use <tt>/Box</tt> subpage which only holds the template contents which is then imported. So there is a [[Rockomax 48-7S/Box]] article which only has the part specific infobox values and [[Rockomax 48-7S]] (also the different languages like [[Rockomax 48-7S/pl]]) then imports this with {{[[Rockomax 48-7S/Box|:Rockomax 48-7S/Box]]}}<!-- the actual code is {{:Rockomax 48-7S/Box}}, but outside the editor it looks like it -->. The colon before the article's name is important, as without it, the software would assume a template (<nowiki>{{Rockomax 48-7S/Box}}</nowiki> would import <tt>Template:Rockomax 48-7S/Box</tt>) and this would separate the specific values form the article.
 
For example the <nowiki>{{Infobox/Part}}</nowiki> template suggests to use <tt>/Box</tt> subpage which only holds the template contents which is then imported. So there is a [[Rockomax 48-7S/Box]] article which only has the part specific infobox values and [[Rockomax 48-7S]] (also the different languages like [[Rockomax 48-7S/pl]]) then imports this with {{[[Rockomax 48-7S/Box|:Rockomax 48-7S/Box]]}}<!-- the actual code is {{:Rockomax 48-7S/Box}}, but outside the editor it looks like it -->. The colon before the article's name is important, as without it, the software would assume a template (<nowiki>{{Rockomax 48-7S/Box}}</nowiki> would import <tt>Template:Rockomax 48-7S/Box</tt>) and this would separate the specific values form the article.
  
If a template support this feature, it should use {{Tl|Data Template}} which automatically categorise the article and add a little help for all the users.
+
If a template support this feature, it should use {{Tl|Data template}} which automatically categorise the article and add a little help for all the users.
  
 
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 <nowiki>{{Infobox/Body}}</nowiki> is required.
 
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 <nowiki>{{Infobox/Body}}</nowiki> is required.

Revision as of 16:21, 26 January 2014

This article is a stub. You can help KSP Wiki by expanding it.

Data templates

Templates with most of it data which doesn't need to be translated can use a special system of storing the values in another template itself. This helps other languages to reuse these values directly and is used for example by all celestial objects with {{Infobox/Body}}. Because every article can be included via templates it is possible to add an article other articles. Templates which are in the Category:Translating templates could be used for this method. It uses a subpage of the article in which the content/values are stored and the article with all the translation then imports this subpage.

For example the {{Infobox/Part}} template suggests to use /Box subpage which only holds the template contents which is then imported. So there is a Rockomax 48-7S/Box article which only has the part specific infobox values and Rockomax 48-7S (also the different languages like Rockomax 48-7S/pl) then imports this with {{:Rockomax 48-7S/Box}}. The colon before the article's name is important, as without it, the software would assume a template ({{Rockomax 48-7S/Box}} would import Template:Rockomax 48-7S/Box) and this would separate the specific values form the article.

If a template support this feature, it should use {{Data template}} which automatically categorise the article and add a little help for all the users.

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.