Difference between revisions of "Template:Infobox"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (*that is actually an icon;)
m
Line 1: Line 1:
<noinclude>{{Infobox
+
<includeonly>{{Infobox
|width=250
+
|width=330
|padding=.5
+
|name={{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}
|tpadding=0
+
|icon={{#if: {{{icon|}}}|{{{icon}}}|Image needed.svg}}
|name=Infobox (name)
+
|file=[[File:{{#if: {{{file|}}}|{{{file}}}|Image needed.svg}}|{{#expr: {{{width|}}} - 10}}px]]
|subtitle=Template (subtitle)
+
----
|icon=Image needed.svg
+
'''Type'''<div style="float:right;">{{#if: {{{type|}}}|{{{type|}}}|Expansion}} </div>
|file=Image needed.svg
+
----
|hovertext=Hover Text (hovertext)
+
'''Release date {{#if: {{{version|}}}|/ Version}}'''<div style="float:right;">{{{date|YYYY-MM-DD}}} {{#if: {{{version|}}}|/ [[{{{version|}}}|{{{version|1.X}}}]]}}</div>
 +
----
 +
'''Store'''<div style="float:right;">[https://kerbalspaceprogram.com/kspstore/index.php?p={{{ksp|example}}} KSP] / [http://store.steampowered.com/app/{{{steam|example}}}/ Steam]</div>
 
|lines=
 
|lines=
{{Infobox/Line|style=text-align:center; font-style:italic;|Homemade Image Subtitle}}
+
}}</includeonly><noinclude>
{{Infobox/Line|One Column}}
+
The template's main purpose is to provide store links while also linking to related information on the DLC in question.
{{Infobox/Line|Two|Columns}}
+
 
{{Infobox/Line|And|Three|Columns}}
+
== Parameters ==
{{Infobox/Line|Multiple Types|Value 1|Value 2|type1=Type 1|type2=Type 2}}
+
{{Parameter table|parameters=
{{Infobox/Line|style=text-align:center; font-size:smaller;|Homemade Footer}}
+
{{Parameter row|title|The DLC title (an icon will be displayed).|Base page name}}
|notes=Annotations & Footnotes (notes)
+
{{Parameter row|icon|Icon of the DLC.|[[:File:Image needed.svg]]}}
 +
{{Parameter row|file|Banner of the DLC (usually from steam for size consistency).|[[:File:Image needed.svg]]}}
 +
{{Parameter row|type|Type of DLC. Currently only '''Expansion'''.|Expansion}}
 +
{{Parameter row|version|The KSP version the DLC released with or was build for.|Not set/Hidden}}
 +
{{Parameter row|date|The date when the DLC was released as ISO date: YYYY-MM-DD.|Not set/Hidden}}
 +
{{Parameter row|ksp|Link to KSP store. Copy everything past <code>https://kerbalspaceprogram.com/kspstore/index.php?p=</code>|Not set/Hidden}}
 +
{{Parameter row|steam|Link to Steam store. The ''appid'' will suffice.|Not set/Hidden}}
 
}}
 
}}
This is a general infobox template, based on the old versions of {{Tl|Infobox/Part}} (''Partbox'') and {{Tl|Infobox/Body}} (''Planetbox''). See [[Template talk:Infobox/Part]] for more information about the new infoboxes.
 
  
{{Parameter table|name=text|style=hover|parameters=
+
== Example ==
{{Parameter row|width|Box width in pixels.|<tt>200</tt>}}
+
The DLC infoxbox for the ''Making History'' expansion will be set up as follows:
{{Parameter row|padding|Padding in <tt>em</tt>.|<tt>0.2</tt>}}
+
 
{{Parameter row|tpadding|Padding of the table in <tt>em</tt>|<tt>0</tt>}}
+
<pre>
{{Parameter row|name|Box title.|Base page name}}
+
{{Infobox/DLC
{{Parameter row|subtitle|Box subtitle|Hidden}}
+
| name=Making History
{{Parameter row|icon|File next to title and subtitle|Not set/Hidden}}
+
| icon=Expansion-MakingHistory.png
{{Parameter row|icon width|File next to title and subtitle width in pixels|If subtitle present: 48 pixels. Else: 37 pixels.}}
+
| file=MakingHistory_Banner.png
{{Parameter row|file|Box image. When set to <tt>none</tt> doesn't display any image.|[[:File:Image needed.svg]]}}
+
| type=Expansion
{{Parameter row|file style|CSS style for the infobox image.|Not set}}
+
| version=1.4.1
{{Parameter row|thumb|An image description displayed below the image|Not set}}
+
| date=2018-03-13
{{Parameter row|file extra1|An extra image displayed below the first image|Not set}}
+
| ksp=5175221000
{{Parameter row|thumb extra1|An image description displayed below the first extra image|Not set}}
+
| steam=283740
{{Parameter row|file extra2|An extra image displayed below the first image|Not set}}
 
{{Parameter row|thumb extra2|An image description displayed below the second extra image|Not set}}
 
{{Parameter row|hovertext|Image hover text.|<tt>name</tt> or base page name}}
 
{{Parameter row|lines|Lines, use {{tl|Infobox/Line}}.}}
 
{{Parameter row|notes|Footnotes, references style.|Invisible}}
 
 
}}
 
}}
 +
</pre>
  
The [[:Category:Infobox templates]] contains all templates which directly use this template.
+
{{Infobox/DLC
 +
| name=Making History
 +
| icon=Expansion-MakingHistory.png
 +
| file=MakingHistory_Banner.png
 +
| type=Expansion
 +
| version=1.4.1
 +
| date=2018-03-13
 +
| ksp=5175221000
 +
| steam=283740
 +
}}
  
[[Category:Infobox templates| ]]</noinclude><includeonly><div class="infobox" style="float: {{if rtl|left|right}}; width: {{{width|200}}}px; margin-{{if rtl|right|left}}: 1em; padding: {{{padding|0.2}}}em; direction: {{if rtl|rtl|ltr}};">
+
[[Category:DLC]]
{| style="font-size: 90%; padding: {{{tpadding|0}}}em; width: 100%" valign="top"
+
[[Category:Infoboxes]]
|-
+
[[Category:Templates]]</noinclude>
| colspan="3" style="background: #ccc; padding: .3em; text-align: center; font-weight: bold;"| <span style="font-size: large; vertical-align: middle">{{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}</span>{{#if:{{{subtitle|}}}|<br/>{{{subtitle}}}|}}{{#if:{{{icon|}}}|<span style="padding-right: .3em; padding-top: .3em; padding-bottom: .3em; text-align: center; font-weight: bold; margin-left: .3em">[[File:{{{icon}}}|{{{icon width|{{#if:{{{subtitle|}}}|48|37}}}}}px]]</span>}}
 
|-
 
{{#ifeq: {{{file|}}}|none||{{!}} {{#if: {{{file style|}}}|style="{{{file style}}}"}} colspan="3" {{!}} [[File:{{#if: {{{file|}}}|{{{file}}}|Image needed.svg}}|{{#expr: {{{width|200}}} - 10}}x{{#expr: {{{width|200}}} - 10}}px|center|{{{hovertext|{{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}}}}]]{{if||{{{thumb|}}}|
 
{{Infobox/Line|style=text-align:center;|{{{thumb}}} }} }}{{if||{{{file extra1|}}}|3=
 
{{(!}} style=text-align:center;
 
{{!}} [[File:{{{file extra1}}}|{{#expr: {{{width|200}}} / 2 - 10}}x{{#expr: {{{width|200}}} / 2 - 10}}px|center|{{#if: {{{thumb extra1|}}}|{{{thumb extra1}}}}}]]
 
{{!}} {{#if: {{{file extra2|}}}|[[File:{{{file extra2}}}|{{#expr: {{{width|200}}} / 2 - 10}}x{{#expr: {{{width|200}}} / 2 - 10}}px|center|{{#if: {{{thumb extra2|}}}|{{{thumb extra2}}}|}}]]}}
 
{{!}}-
 
{{!}} {{#if: {{{thumb extra1|}}}|{{{thumb extra1}}}}}
 
{{!}} {{#if: {{{file extra2|}}}|{{#if: {{{thumb extra2|}}}|{{{thumb extra2}}} }} }}
 
{{!}}} }} }}
 
{{{lines}}}
 
{{#if: {{{notes|}}}|{{!}}-
 
{{!}} colspan="3" style="font-size: smaller" {{!}}
 
----
 
{{{notes}}} }}
 
|}
 
</div></includeonly>
 

Revision as of 21:06, 18 March 2018

The template's main purpose is to provide store links while also linking to related information on the DLC in question.

Parameters

# Optional Description Default
title Yes The DLC title (an icon will be displayed). Base page name
icon Yes Icon of the DLC. File:Image needed.svg
file Yes Banner of the DLC (usually from steam for size consistency). File:Image needed.svg
type Yes Type of DLC. Currently only Expansion. Expansion
version Yes The KSP version the DLC released with or was build for. Not set/Hidden
date Yes The date when the DLC was released as ISO date: YYYY-MM-DD. Not set/Hidden
ksp No Not set/Hidden
steam Yes Link to Steam store. The appid will suffice. Not set/Hidden

Example

The DLC infoxbox for the Making History expansion will be set up as follows:

{{Infobox/DLC
| name=Making History
| icon=Expansion-MakingHistory.png
| file=MakingHistory_Banner.png
| type=Expansion
| version=1.4.1
| date=2018-03-13
| ksp=5175221000
| steam=283740
}}
Making HistoryExpansion-MakingHistory.png
Making History
Type Expansion
Release date / Version 2018-03-13 / 1.4.1
Store KSP / Steam