Template:Infobox

From Kerbal Powers Wiki
Revision as of 02:20, 7 March 2021 by JuanHorse (talk | contribs)
Jump to: navigation, search
You should not directly use this template, it serves as a base for other Infoboxes templates to inherit from. See this list of other infobox templates.


{{{title}}}

{{{illustration}}}
{{{caption}}}
{{{example_section}}}
Sample data {{{example_data}}}


Example

Example

KP dark.png
Example infobox
Example section
Sample data Soap floats on water, but its efficiency at naval battles is yet to be proven


The following markup will produce the output presented to the right of this paragraph :

{{Infobox
 | title = Example
 | illustration = [[File:KP dark.png]]
 | caption = Example infobox
 | example_section = Example section
 | example_data = Soap floats on water, but its efficiency at naval battles is yet to be proven
}}

Templates are floated to the right, which means they will appear in the document shifted to the right of the page, whilst being kept in the document flow (ie, text will wrap around them. Templates will "clear" off each other, and appear below the previous ones in the order they were added into the document flow. As an example, there is a template between here...

A second infobox

{{{illustration}}}
Test
{{{example_section}}}
Sample data {{{example_data}}}

...and here, and it should appear directly below the previous one. This behaviour may sometimes cause problems with block elements (see the CSS display modes), as these elements typically will ignore floats and "slide" underneath them, whereas their content will behave normally and wrap around the floating element.

To solve that problem, or for readability and design, you will often find yourself in need of "pushing" the rest of the document's flow after a floating box. The Template:clr will do that for you, and is used by inserting {{clr}} at any point in your document. All content after that point will clear from all floating elements and will appear below them, like this paragraph.

Using, creating and modifying infoboxes

Usage

You should not directly use this template itself. Instead use other templates already created in Category:Infoboxes, or create a new one. This template serves as a framework to define common rules between all infoboxes and providing a root page for sub-templates defined below.

Sub-templates components

In order to ease the creation of infoboxes, this basic template is itself made of reusable components which can be reused in other templates. They are listed below, and may be used in your own templates. You can also create new ones.

  • {{Infobox/Header|...}} : This component defines the header title of an infobox (the "bold greyed" part at the top of an infobox). The following arguments can be used :
    • title : The title to display.
  • {{Infobox/Illustration|...}} : This component represents an image and it's associated caption which are usually used to illustrate an infobox. The following arguments can be used :
    • file : The picture to display (which can be uploaded or inserted using the editor's "Embed File" button)
    • caption : A caption for the picture
  • {{Infobox/SectionHeader|...}} : This component defines a section header, which helps grouping and separating attributes in an infobox. The following arguments can be used :
    • section : The new section's title
  • {{Infobox/Item|...}} : This is the basic "key-value" attribute of an infobox used to present a piece of data with a label. The following arguments can be used :
    • key : The (readable) label of an attribute, which should consist of a few, chosen words like "Type" or "Date of birth". Avoid long labels like "Date at which this aircraft experienced its first air battle over foreign territory", they tend to break the infobox's design by making it hard to read.
    • value : The value (content) of the attribute.

Specifications

Generic floating infobox.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Titletitle

Title that appears at the top of the infobox.

Default
Infobox
Example
empty
Auto value
empty
Stringrequired
Illustrationillustration

A picture describing the subject.

Default
empty
Example
empty
Auto value
empty
Fileoptional
Captioncaption

A short descriptive text for the illustration.

Default
empty
Example
empty
Auto value
empty
Stringoptional
Example_sectionexample_section

This is only used for demonstration purposes. Any children template inheriting from this one should remove this attribute.

Default
empty
Example
empty
Auto value
empty
Unknowndeprecated
Example_dataexample_data

This is only used for demonstration purposes. Any children template inheriting from this one should remove this attribute.

Default
empty
Example
empty
Auto value
empty
Unknowndeprecated
Nofloatnofloat

Setting any value to this parameter will make the infobox stop floating to the right.

Default
empty
Example
empty
Auto value
empty
Unknownoptional