Navigation menu

Template:Infobox/doc: Difference between revisions

From The Kodiak Republic Wiki

no edit summary
m (7 revisions imported from templatewikiarchive:Template:Infobox/doc)
No edit summary
Line 1:
{{distinguish|Template:Userbox}}
{{Documentation subpage}}
{{Lua|Module:Infobox}}
{{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. [[w:Help:Infobox]] contains an introduction about the recommended content and design of infoboxes.
Line 80 ⟶ 66:
; data(n) : Text to display as data in row n.
 
Note: for any given value for (n), not all combinations of parameters are permitted. The presence of a {{para|header''(n)''}} parameter will cause the corresponding {{para|data''(n)''}} (and {{para|rowclass''(n)''}} {{para|label''(n)''}}, see below) parameters to be ignored; the absence of a {{para|data''(n)''}} parameters will cause the corresponding {{para|label''(n)''}} parameters to be ignored. Valid combinations for any single row are:
 
* {{para|class''(n)''}}= {{para|header''(n)''}}=
* {{para|rowclass''(n)''}}= {{para|class''(n)''}}= {{para|data''(n)''}}=
* {{para|rowclass''(n)''}}= {{para|label''(n)''}}= {{para|class''(n)''}}= {{para|data''(n)''}}=
 
See the rendering of header4, label4, and data4 in the [[#Examples|Examples]] section below.
Line 179 ⟶ 165:
Titles of articles with infoboxes may be made italic, in line with [[WP:ITALICTITLE]], by passing the <code>italic title</code> parameter.
 
* Turn on italic titles by passing {{para|italic title|=<nowiki>{{{italic title|}}}</nowiki>}} from the infobox.
* Turn off by default (notably because only Latin script may be safely rendered in this style and italic may be needed to distinguish foreign language from local English language only in that script, but would be difficult to read for other scripts) but allow some instances to be made italic by passing {{para|italic title|=<nowiki>{{{italic title|no}}}</nowiki>}}
* Do not make any titles italic by not passing the parameter at all.
 
Line 385 ⟶ 371:
 
== Embedding ==
One infobox template can be embedded into another using the {{para|child}}= parameter or the {{para|embed}}= parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
<!--Linked from [[Template:Subinfobox bodystyle/doc]]-->
One infobox template can be embedded into another using the {{para|child}} parameter or the {{para|embed}} parameter. This feature can be used to create a modular infobox, or to create better-defined logical sections. Long ago, it was necessary to use embedding in order to create infoboxes with more than 99 rows; but nowadays there's no limit to the number of rows that can be defined in a single instance of <code><nowiki>{{infobox}}</nowiki></code>.
 
{{Infobox
Line 491 ⟶ 476:
</pre>{{clear}}
 
Note that omitting the {{para|title}}= parameter, and not including any text preceding the embedded infobox, may result in spurious blank table rows, creating gaps in the visual presentation.
 
== Subboxes ==
An alternative method for embedding is to use {{para|subbox|=yes}}, which removes the outer border from the infobox, but preserves the interior structure. One feature of this approach is that the parent and child boxes need not have the same structure, and the label and data fields are not aligned between the parent and child boxes because they are not in the same parent table.
 
{{Infobox
Line 537 ⟶ 522:
</source>{{clear}}
 
Similar embedding techniques may be used within content parameters of some other templates generating tables (such as [[:Template:Sidebar|Sidebar]]) :
 
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
<source lang="sass" style="overflow:auto">
{{Sidebar
| navbar = off
| headingstyle = background-color:#eee;
| heading1 = Heading 1
| heading2 = Heading 2
| content3 = {{Infobox | subbox = yes
| headerstyle = background-color:#ccc;
| labelstyle = background-color:#ddd;
| header1 = Sub 3-1
| header2 = Sub 3-2
| label3 = Label 3-3 | data3 = Data 3-3
}}
| content4 = {{Infobox | subbox = yes
| labelstyle = background-color:#ccc;
| label1 = Label 4-1 | data1 = Data 4-1
}}
| heading5 = Heading 5
}}
</source>{{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.
Line 673 ⟶ 618:
}}
</pre>{{clear}}
{{Help:Infobox/user style}}
 
==See also==
* [[Module:Infobox]], the [[mw:Lua/Overview|Lua]] module on which this template is based
* [[w:Wikipedia:List of infoboxes|List of infoboxes]]
* {{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]]
** [[:Category:Pages which use embedded infobox templates with the title parameter]]
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
[[Category:Infobox templates| ]]
[[Category:Metatemplates|Infobox]]
}}</includeonly>
0

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.