Difference between revisions of "Template:Infobox"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (*make image smaller than the infobox;)
m (*allow file and name set to nothing and still showing defaults;)
Line 22: Line 22:
 
{{Parameter Row|tpadding|Padding of the table in <tt>em</tt>|0}}
 
{{Parameter Row|tpadding|Padding of the table in <tt>em</tt>|0}}
 
{{Parameter Row|name|Box title.|Base page name}}
 
{{Parameter Row|name|Box title.|Base page name}}
{{Parameter Row|file|Box image. When set to <tt>none</tt> doesn't display any image.|Image-needed.png}}
+
{{Parameter Row|file|Box image. When set to <tt>none</tt> doesn't display any image.|[[:File:Image-needed.png]]}}
 
{{Parameter Row|file style|CSS style for the infobox image. The property <tt>text-align</tt> is always set to centered.|Not set}}
 
{{Parameter Row|file style|CSS style for the infobox image. The property <tt>text-align</tt> is always set to centered.|Not set}}
 
{{Parameter Row|hovertext|Image hover text.|<tt>name</tt> or base page name}}
 
{{Parameter Row|hovertext|Image hover text.|<tt>name</tt> or base page name}}
Line 31: Line 31:
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>
 
<includeonly><div style="background: #f6f6f6; border: 1px solid #ccc; float: {{if rtl|left|right}}; width: {{{width|200}}}px; margin-{{if rtl|right|left}}: 1em; padding: {{{padding|0.5}}}em; direction: {{if rtl|rtl|ltr}}">
 
<includeonly><div style="background: #f6f6f6; border: 1px solid #ccc; float: {{if rtl|left|right}}; width: {{{width|200}}}px; margin-{{if rtl|right|left}}: 1em; padding: {{{padding|0.5}}}em; direction: {{if rtl|rtl|ltr}}">
<div style="background: #ccc; font-size: large; padding: .5em; text-align: center">{{{name|{{BASEPAGENAME}}}}}</div>
+
<div style="background: #ccc; font-size: large; padding: .5em; text-align: center">{{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}</div>
 
{| style="font-size: 90%; padding: {{{tpadding|0}}}em; width: 100%" valign="top"
 
{| style="font-size: 90%; padding: {{{tpadding|0}}}em; width: 100%" valign="top"
 
|-
 
|-
{{#ifeq: {{{file|}}}|none||{{!}} {{#if: {{{file style|}}}|style="text-align:center; {{{file style}}}"}} colspan="3" {{!}} [[File:{{{file|Image-needed.png}}}|{{#expr: {{{width|200}}} - 10}}px|{{{hovertext|{{{name|{{BASEPAGENAME}}}}}}}}]]}}
+
{{#ifeq: {{{file|}}}|none||{{!}} {{#if: {{{file style|}}}|style="text-align:center; {{{file style}}}"}} colspan="3" {{!}} [[File:{{#if: {{{file|}}}|{{{file}}}|Image-needed.png}}|{{#expr: {{{width|200}}} - 10}}px|{{{hovertext|{{#if: {{{name|}}}|{{{name}}}|{{BASEPAGENAME}}}}}}}]]}}
 
{{{lines}}}
 
{{{lines}}}
 
{{#if: {{{notes|}}}|{{!}}-
 
{{#if: {{{notes|}}}|{{!}}-

Revision as of 16:33, 19 August 2013

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

Template:Parameter Table