Difference between revisions of "Template:Infobox/doc"

From MINR.ORG WIKI
(Replaced content with "Used for Template:Infobox_Map.")
(Tag: Replaced)
(Cuts down the page more to something more readable)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Used for [[Template:Infobox_Map]].
+
{{Documentation subpage}}
 +
<includeonly>{{#ifeq:{{#titleparts:{{PAGENAME}}|1|2}}|old | |{{High-risk|2900000+}}{{Lua|Module:Infobox}}}}</includeonly>
 +
{{Parameter names example
 +
|name={{PAGENAME}} <!--|child |subbox |decat--> |title |above |subheader |subheader1 |subheader2={{{subheader2}}}<br/>......
 +
|image|caption |image1|caption1 |image2|caption2={{{caption2}}}<br/>......
 +
|header1=<div style="border-top:1px dashed #ccc;">{{{header1}}}<br/>{{nobold|( ''or'' )}}</div>
 +
|label2={{{label1}}} |data2={{{data1}}}
 +
|data3=( ''or'' ) |data4=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data1}}}</div>
 +
|header5={{{header2}}}<br/><div style="padding:0.75em 0 0.5em;">{{nobold|( ''or'' )}}</div>
 +
|label6={{{label2}}} |data6={{{data2}}}
 +
|data7=( ''or'' ) |data8=<div style="padding-bottom:0.25em;border-bottom:1px dashed #ccc;">{{{data2}}}</div>
 +
|data9=<div style="padding:0.75em 0 0.5em;">( ''etc'' )</div>
 +
|below
 +
}}
 +
 
 +
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. [[Wikipedia:Help:Infobox]] contains an introduction about the recommended content and design of infoboxes; [[Wikipedia:Manual of Style/Infoboxes]] contains additional style guidelines. See [[Wikipedia:List of infoboxes]] and [[Wikipedia:Category:Infobox templates]] for lists of prepared topic-specific infoboxes.
 +
 
 +
== Usage ==
 +
Usage is similar to {{tl|navbox}}, 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 infobox, or to insert freeform data, use a row with only a data field.
 +
 
 +
== Optional control parameters ==
 +
; name : If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value <nowiki>{{subst:PAGENAME}}</nowiki>; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
 +
; child :  See the [[#Embedding|Embedding]] section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
 +
; subbox :  See the [[#Subboxes|Subboxes]] section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the '''child''' parameter is also set to "yes".
 +
; decat : If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.
 +
 
 +
== Content parameters ==
 +
 
 +
=== Title ===
 +
There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):
 +
 
 +
; title : Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For [[Wikipedia:Manual of Style/Accessibility#Tables|accessibility reasons]], this is the most recommended alternative.
 +
; above : Text to put within the uppermost cell of the table.
 +
; subheader(n) : additional title fields which fit below {{{title}}} and {{{above}}}, but before images.
 +
 
 +
Examples:
 +
 
 +
{{Infobox
 +
| name = Infobox/doc
 +
| title      = Text in caption over infobox
 +
| subheader  = Subheader of the infobox
 +
| header = (the rest of the infobox goes here)
 +
}}
 +
<pre style="overflow:auto">
 +
{{Infobox
 +
| name = {{subst:PAGENAME}}
 +
| title      = Text in caption over infobox
 +
| subheader  = Subheader of the infobox
 +
| header = (the rest of the infobox goes here)
 +
}}
 +
</pre>{{clear}}
 +
 
 +
{{Infobox
 +
| name = Infobox/doc
 +
| above      = Text in uppermost cell of infobox
 +
| subheader  = Subheader of the infobox
 +
| subheader2 = Second subheader of the infobox
 +
| header = (the rest of the infobox goes here)
 +
}}
 +
<pre style="overflow:auto">
 +
{{Infobox
 +
| name = {{subst:PAGENAME}}
 +
| above      = Text in uppermost cell of infobox
 +
| subheader  = Subheader of the infobox
 +
| subheader2 = Second subheader of the infobox
 +
| header = (the rest of the infobox goes here)
 +
}}
 +
</pre>{{clear}}
 +
 
 +
== Full blank syntax ==
 +
(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)
 +
 
 +
<pre style="overflow:auto">
 +
{{Infobox
 +
| name          = {{subst:PAGENAME}}
 +
| child          = {{{child|}}}
 +
| subbox        = {{{subbox|}}}
 +
| italic title  = {{{italic title|no}}}
 +
| bodystyle      =
 +
 
 +
| titlestyle    =
 +
| abovestyle    =
 +
| subheaderstyle =
 +
| title          =
 +
| above          =
 +
| subheader      =
 +
 
 +
|  imagestyle  =
 +
| captionstyle  =
 +
|  image        =
 +
| caption        =
 +
|  image2      =
 +
| caption2      =
 +
 
 +
| headerstyle    =
 +
|  labelstyle    =
 +
|  datastyle    =
 +
| header1  =
 +
|  label1  =
 +
|  data1  =
 +
| header2  =
 +
|  label2  =
 +
|  data2  =
 +
| header3  =
 +
|  label3  =
 +
|  data3  =
 +
| header4  =
 +
|  label4  =
 +
|  data4  =
 +
| header5  =
 +
|  label5  =
 +
|  data5  =
 +
| header6  =
 +
|  label6  =
 +
|  data6  =
 +
| header7  =
 +
|  label7  =
 +
|  data7  =
 +
| header8  =
 +
|  label8  =
 +
|  data8  =
 +
| header9  =
 +
|  label9  =
 +
|  data9  =
 +
| header10 =
 +
|  label10 =
 +
|  data10 =
 +
| header11 =
 +
|  label11 =
 +
|  data11 =
 +
| header12 =
 +
|  label12 =
 +
|  data12 =
 +
| header13 =
 +
|  label13 =
 +
|  data13 =
 +
| header14 =
 +
|  label14 =
 +
|  data14 =
 +
| header15 =
 +
|  label15 =
 +
|  data15 =
 +
| header16 =
 +
|  label16 =
 +
|  data16 =
 +
| header17 =
 +
|  label17 =
 +
|  data17 =
 +
| header18 =
 +
|  label18 =
 +
|  data18 =
 +
| header19 =
 +
|  label19 =
 +
|  data19 =
 +
| header20 =
 +
|  label20 =
 +
|  data20 =
 +
 
 +
| belowstyle    =
 +
| below          =
 +
}}
 +
</pre>{{clear}}
 +
 
 +
== Porting to other MediaWikis ==
 +
The infobox template requires the [[:mw:Extension:Scribunto|Scribunto]] extension and [[mw:Manual:Using content from Wikipedia#HTMLTidy|HTMLTidy]] to be installed. It may not work with other MediaWikis. [[Wikipedia:WikiProject Transwiki|WikiProject Transwiki]] has a version of this template that has been modified to work on other MediaWikis.
 +
 
 +
==See also==
 +
* [[Module:Infobox]], the [[Wikipedia:LUA|Lua]] module on which this template is based

Latest revision as of 22:01, 14 January 2026


{{{title}}}
{{{above}}}
{{{subheader}}}
{{{subheader2}}}
......
{{{image}}}
{{{caption}}}
{{{image2}}}
{{{caption2}}}
......
{{{header1}}}
( or )
{{{label1}}} {{{data1}}}
( or )
{{{data1}}}
{{{header2}}}
( or )
{{{label2}}} {{{data2}}}
( or )
{{{data2}}}
( etc )
{{{below}}}

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. Wikipedia:Help:Infobox contains an introduction about the recommended content and design of infoboxes; Wikipedia:Manual of Style/Infoboxes contains additional style guidelines. See Wikipedia:List of infoboxes and Wikipedia:Category:Infobox templates for lists of prepared topic-specific infoboxes.

Usage[edit]

Usage is similar to {{navbox}}, 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 infobox, or to insert freeform data, use a row with only a data field.

Optional control parameters[edit]

name 
If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named page. You may use the value {{subst:PAGENAME}}; however this is rarely what you want, because it will send users clicking these links in an infobox in an article to the template code rather than the data in the infobox that they probably want to change.
child 
See the Embedding section for details. If this is set to "yes", this child infobox should be titled but have no name parameter. This parameter is empty by default, set it to "yes" to activate it.
subbox 
See the Subboxes section for details. If this is set to "yes", this subbox should be titled but have no name parameter. This parameter is empty by default, set to "yes" to activate it. It has no effect if the child parameter is also set to "yes".
decat 
If this is set to "yes", the current page will not be autocategorized in a maintenance category when the generated infobox has some problems or no visible data section. Leave empty by default or set to "yes" to activate it.

Content parameters[edit]

Title[edit]

There are two different ways to put a title on an infobox. One contains the title inside the infobox's border in the uppermost cell of the table, the other puts as a caption it on top of the table. You can use both of them together if you like, or just one or the other, or even neither (though this is not recommended):

title 
Text to put in the caption over the top of the table (or as section header before the whole content of this table, if this is a child infobox). For accessibility reasons, this is the most recommended alternative.
above 
Text to put within the uppermost cell of the table.
subheader(n) 
additional title fields which fit below {{{title}}} and {{{above}}}, but before images.

Examples:

Text in caption over infobox
Subheader of the infobox
{{Infobox
 | name = {{subst:PAGENAME}}
 | title      = Text in caption over infobox
 | subheader  = Subheader of the infobox
 | header = (the rest of the infobox goes here)
}}
Text in uppermost cell of infobox
Subheader of the infobox
Second subheader of the infobox
{{Infobox
 | name = {{subst:PAGENAME}}
 | above      = Text in uppermost cell of infobox
 | subheader  = Subheader of the infobox
 | subheader2 = Second subheader of the infobox
 | header = (the rest of the infobox goes here)
}}

Full blank syntax[edit]

(Note: there is no limit to the number of possible rows; only 20 are given below since infoboxes larger than that will be relatively rare. Just extend the numbering as needed. The microformat "class" parameters are also omitted as they are not commonly used.)

{{Infobox
| name           = {{subst:PAGENAME}}
| child          = {{{child|}}}
| subbox         = {{{subbox|}}}
| italic title   = {{{italic title|no}}}
| bodystyle      = 

| titlestyle     = 
| abovestyle     = 
| subheaderstyle = 
| title          = 
| above          = 
| subheader      = 

|   imagestyle   = 
| captionstyle   = 
|   image        = 
| caption        = 
|   image2       = 
| caption2       = 

| headerstyle    = 
|  labelstyle    = 
|   datastyle    = 
| header1  = 
|  label1  = 
|   data1  = 
| header2  = 
|  label2  = 
|   data2  = 
| header3  = 
|  label3  = 
|   data3  = 
| header4  = 
|  label4  = 
|   data4  = 
| header5  = 
|  label5  = 
|   data5  = 
| header6  = 
|  label6  = 
|   data6  = 
| header7  = 
|  label7  = 
|   data7  = 
| header8  = 
|  label8  = 
|   data8  = 
| header9  = 
|  label9  = 
|   data9  = 
| header10 = 
|  label10 = 
|   data10 = 
| header11 = 
|  label11 = 
|   data11 = 
| header12 = 
|  label12 = 
|   data12 = 
| header13 = 
|  label13 = 
|   data13 = 
| header14 = 
|  label14 = 
|   data14 = 
| header15 = 
|  label15 = 
|   data15 = 
| header16 = 
|  label16 = 
|   data16 = 
| header17 = 
|  label17 = 
|   data17 = 
| header18 = 
|  label18 = 
|   data18 = 
| header19 = 
|  label19 = 
|   data19 = 
| header20 = 
|  label20 = 
|   data20 = 

| belowstyle     = 
| below          = 
}}

Porting to other MediaWikis[edit]

The infobox template requires the Scribunto extension and HTMLTidy to be installed. It may not work with other MediaWikis. WikiProject Transwiki has a version of this template that has been modified to work on other MediaWikis.

See also[edit]