This template is intended as a meta template: a template used for constructing other templates. '''Note''': In general, it is not meant for use directly in an article, but can be used on a one-off basis if required. [[Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[WP:List of infoboxes]] and [[:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
== Usage ==
Usage {{tlf|Infobox}} is similar a meta-template: used to organise an actual <nowiki>{{Infobox sometopic}}</nowiki> template (like {{tl|navboxInfobox building}}, but with an additional distinction. Each row on the table can contain either a header, or a label/data pair, or just a data cell. These are mutually exclusive states so if you define a row with both a header and a label/data pair, the label/data pair is ignored).
To insert an image somewhere other than at the top of the infoboxFor <code><nowiki>[[Template:Infobox sometopic]]</nowiki></code>, or to insert freeform datatemplate code then looks like this, use a row with only a data fieldsimplified:<pre>{{Infobox| name = {{{name|{{PAGENAME}}}}}| image = {{{image|}}}| caption1 = {{{caption|}}}}}} | label1 = Former names| data1 = {{{former_names|}}} | header2 = General information | label3 = Status| data3 = {{{status|}}}... <!-- etc.-->}}</pre>
== Optional control parameters ==
| label6 = Static item | data6 = Static value
}}
<pre source lang="moin" style="overflow:auto">
{{Infobox
| title = Example of an optional header
| label6 = Static item | data6 = Static value
}}
</presource>{{clear}}
header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no emty empty row appears before the next static content. The trick to this is that the "<code>#if" </code> returns false only if there is nothing whatsoever in the conditional section, so only if all three of item1, item2 and item3 are undefined will the if statement fail.
Note that such trick may be sometimes very complex to test if there are many data items whose value depends on complex tests (or when a data row is generated by a recursive invokation of this template as a [[#Subboxes|subbox]]). Ideally, the Lua module supporting this template should now support a new way to make each header row autohideable by detecting if there is at least one non-empty data row after that header row (a parameter like "{{para|autohide header1 = | yes"}}, for example, would remove the need to perform the "<code>#if" </code> test so that we can just to define "{{para|header1 = | Optional header"}}),
For this example, the '''{{para|bodystyle''' }} and '''{{para|labelstyle''' }} parameters are used to adjust the infobox width and define a default width for the column of labels:
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
| heading5 = Heading 5
}}
<pre source lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| heading5 = Heading 5
}}
</presource>{{clear}}
Note that the default padding of the parent data cell containing each subbox is still visible, so the subboxes are slightly narrower than the parent box and there's a higher vertical spacing between standard cells of the parent box than between cells of distinct subboxes.
| label20 =
| data20 =
(there is not a 20-row limit; 20 rows are provided as example)
| belowstyle =
| below =
* [[Module:Infobox]], the [[WP:LUA|Lua]] module on which this template is based
* [[Special:Permalink/558855956|Template:Infobox/old]], the previous ParserFunctions implementation
* [[Module:Check for unknown parameters]]
* {{tl|Infobox3cols}}
* {{tl|Navbox}} and {{tl|Sidebar}}
* [[Wikipedia:List of infoboxes|List of infoboxes]]
* [[:Module:InfoboxImage]]
* Maintenance categories:
** [[:Category:Articles which use infobox templates with no data rows]]({{PAGESINCATEGORY:Articles which use infobox templates with no data rows|pages}})** [[:Category:Pages which use embedded infobox templates with the title parameter]]({{PAGESINCATEGORY:Pages which use embedded infobox templates with the title parameter|pages}})
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Infobox templates| ]]
[[Category:Wikipedia metatemplates|Infobox]]
[[Category:Templates generating microformats]]
[[Category:Lua-based infobox templates]]
}}</includeonly>
==Tracking categories==
* {{clc|Articles with missing Wikidata information}}