Difference between revisions of "Template:Infobox"

From Kerbal Space Program Wiki
Jump to: navigation, search
m
(make title more visible)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
<includeonly>{{Infobox
+
<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}};">
|width=330
+
{| style="font-size: 90%; padding: {{{tpadding|0}}}em; width: 100%" valign="top"
|name={{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}
+
|-
|icon={{#if: {{{icon|}}}|{{{icon}}}|Image needed.svg}}
+
| colspan="3" style="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>}}
|file={{#if: {{{file|}}}|[[File:{{{file}}}|Image needed.svg|{{#expr: {{{width|}}} - 10}}px]]}}
+
|-
 +
{{#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" {{!}}
 
----
 
----
'''Type'''<div style="float:right;">{{#if: {{{type|}}}|{{{type|}}}|Expansion}} </div>
+
{{{notes}}} }}
----
+
|}
'''Release date {{#if: {{{version|}}}|/ Version}}'''<div style="float:right;">{{{date|YYYY-MM-DD}}} {{#if: {{{version|}}}|/ [[{{{version|}}}|{{{version|1.X}}}]]}}</div>
+
</div></includeonly><noinclude>
----
+
{{Documentation}}
'''Store'''<div style="float:right;">[https://kerbalspaceprogram.com/kspstore/index.php?p={{{ksp|example}}} KSP] / [http://store.steampowered.com/app/{{{steam|example}}}/ Steam]</div>
+
</noinclude>
|lines=
 
}}</includeonly><noinclude>
 
The template's main purpose is to provide store links while also linking to related information on the DLC in question.
 
 
 
== Parameters ==
 
{{Parameter table|parameters=
 
{{Parameter row|title|The DLC title (an icon will be displayed).|Base page name}}
 
{{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}}
 
}}
 
 
 
== Example ==
 
The DLC infoxbox for the ''Making History'' expansion will be set up as follows:
 
 
 
<pre>
 
{{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
 
}}
 
</pre>
 
 
 
{{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:DLC]]
 
[[Category:Infoboxes]]
 
[[Category:Templates]]</noinclude>
 

Latest revision as of 00:29, 17 January 2023

Documentation icon Template documentation[view] [edit] [history] [purge]Pages that link to Template:Infobox
Infobox (name)
Template (subtitle)Image needed.svg
Hover Text (hovertext)
Homemade Image Subtitle
One Column
Two Columns
And Three
Columns
Multiple Types (Type 1) Value 1
(Type 2) Value 2
Homemade Footer

Annotations & Footnotes (notes)

This is a general infobox template, based on the old versions of {{Infobox/Part}} (Partbox) and {{Infobox/Body}} (Planetbox). See Template talk:Infobox/Part for more information about the new infoboxes.

Parameters

Name Optional Description Default
width Yes Box width in pixels. 200
padding Yes Padding in em. 0.2
tpadding Yes Padding of the table in em 0
name Yes Box title. Base page name
subtitle Yes Box subtitle Hidden
icon Yes File next to title and subtitle Not set/Hidden
icon width Yes File next to title and subtitle width in pixels If subtitle present: 48 pixels. Else: 37 pixels.
file Yes Box image. When set to none doesn't display any image. File:Image needed.svg
file style Yes CSS style for the infobox image. Not set
thumb Yes An image description displayed below the image Not set
file extra1 Yes An extra image displayed below the first image Not set
thumb extra1 Yes An image description displayed below the first extra image Not set
file extra2 Yes An extra image displayed below the first image Not set
thumb extra2 Yes An image description displayed below the second extra image Not set
hovertext Yes Image hover text. name or base page name
lines No Lines, use {{Infobox/Line}}.
notes Yes Footnotes, references style. Invisible

The Category:Infobox templates contains all templates which directly use this template.