Template:Infobox
{{{title}}}
|
|||||
---|---|---|---|---|---|
{{{illustration}}} | |||||
{{{caption}}} | |||||
Sample data | {{{example_data}}} |
Example
Example
|
|||||
---|---|---|---|---|---|
Example infobox | |||||
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 | |||||
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.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Title | title | Title that appears at the top of the infobox.
| String | required |
Illustration | illustration | A picture describing the subject. | File | optional |
Caption | caption | A short descriptive text for the illustration. | String | optional |
example_data | example_data | This is only used for demonstration purposes. Any children template inheriting from this one should remove this attribute. | Unknown | deprecated |