Difference between revisions of "Template:Infobox"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (TEST for nextToIcon -> border 0px ;)
(nextToIcon parameter now functionnal ; removed #ccc background color behind next to icon ; added parameter rows ; added subtitle preview ; added nextToIcon preview)
Line 4: Line 4:
 
|tpadding=0
 
|tpadding=0
 
|name=Infobox (name)
 
|name=Infobox (name)
 +
|subtitle=Template (subtitle)
 +
|nextToIcon=Image needed.svg
 
|file=Image needed.svg
 
|file=Image needed.svg
 
|hovertext=Hover Text (hovertext)
 
|hovertext=Hover Text (hovertext)
Line 22: Line 24:
 
{{Parameter row|tpadding|Padding of the table in <tt>em</tt>|<tt>0</tt>}}
 
{{Parameter row|tpadding|Padding of the table in <tt>em</tt>|<tt>0</tt>}}
 
{{Parameter row|name|Box title.|Base page name}}
 
{{Parameter row|name|Box title.|Base page name}}
 +
{{Parameter row|subtitle|Box subtitle|Hidden}}
 +
{{Parameter row|nextToIcon|File next to title and subtitle|Not set/Hidden}}
 +
{{Parameter row|nextToIcon width|File next to title and subtitle width in pixels|If subtitle present: 48 pixels. Else: 37 pixels.}}
 
{{Parameter row|file|Box image. When set to <tt>none</tt> doesn't display any image.|[[:File:Image needed.svg]]}}
 
{{Parameter row|file|Box image. When set to <tt>none</tt> doesn't display any image.|[[:File:Image needed.svg]]}}
 
{{Parameter row|file style|CSS style for the infobox image.|Not set}}
 
{{Parameter row|file style|CSS style for the infobox image.|Not set}}
Line 40: Line 45:
 
|-
 
|-
 
| colspan="{{#if:{{{nextToIcon|}}}|2|3}}" style="background: #ccc; padding{{#if:{{{nextToIcon|}}}|-top|}}: .3em; {{#if:{{{nextToIcon|}}}|padding-bottom:.3em; padding-left: .3em; border:0px;|}} text-align: center; font-weight: bold;"| <span style="font-size: large">{{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}</span>{{#if:{{{subtitle|}}}|<br/>{{{subtitle}}}|}}
 
| colspan="{{#if:{{{nextToIcon|}}}|2|3}}" style="background: #ccc; padding{{#if:{{{nextToIcon|}}}|-top|}}: .3em; {{#if:{{{nextToIcon|}}}|padding-bottom:.3em; padding-left: .3em; border:0px;|}} text-align: center; font-weight: bold;"| <span style="font-size: large">{{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}</span>{{#if:{{{subtitle|}}}|<br/>{{{subtitle}}}|}}
{{#if:{{{nextToIcon|}}}|{{!}}style="background: #ccc; padding-right: .3em; padding-top: .3em; padding-bottom: .3em; border:0px; text-align: center; font-weight: bold; width:20%"{{!}}[[File:{{{nextToIcon|Image needed.svg}}}|{{{nextToIcon width|37}}}px]]|}}
+
{{#if:{{{nextToIcon|}}}|{{!}}style="padding-right: .3em; padding-top: .3em; padding-bottom: .3em; border:0px; text-align: center; font-weight: bold; width:20%"{{!}}[[File:{{{nextToIcon|Image needed.svg}}}|{{{nextToIcon width|{{#if:{{{subtitle|}}}|48|37}}}}}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|}}}|
 
{{#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|}}}|

Revision as of 10:29, 11 January 2015

Infobox (name)
Template (subtitle)
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.

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
nextToIcon Yes File next to title and subtitle Not set/Hidden
nextToIcon 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.