Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Infobox/doc: Difference between revisions

Template page
m Add dependency.
m Fix typo.
 
(6 intermediate revisions by the same user not shown)
Line 8: Line 8:
:: {{T|CMBSiteInfo}}
:: {{T|CMBSiteInfo}}
:: {{T|Infobox agent}}
:: {{T|Infobox agent}}
:: {{T|Infobox coordinator}}
:: {{T|Infobox corporation}}
:: {{T|Infobox corporation}}
:: {{T|Infobox gas nebula}}
:: {{T|Infobox gas nebula}}
:: {{T|Infobox Mentors}}
:: {{T|Infobox Mentors}}
:: {{T|Infobox Mentors Anon}}
:: {{T|Infobox militia}}
:: {{T|Infobox militia}}
:: {{T|Infobox Wiki Supporter}}
:: {{T|HomefrontOperation}}


; Syntax
; Syntax
Line 37: Line 41:


| header1  =  
| header1  =  
|  label1  =
 
|  data1  =
| header2  =
|  label2  =  
|  label2  =  
|  data2  =  
|  data2  =  
| header3  =
|  label4  =
|  data4  =
...
...
| header20 =  
| header20 =  
label20 =  
 
data20 =  
label21 =  
data21 =  


| belowstyle    =  
| belowstyle    =  
Line 51: Line 59:
}}</pre>
}}</pre>


; Parameters
:; Parameters
: <code>name</code>
::; name : If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named template. It must be written exactly as the name of the template.
:: If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named template.
:; Parameters (data)
: <code>above</code>
:: Parameters left empty will not be displayed
:: Text to put within the uppermost cell of the table.
::; title : Infobox title
: <code>subheader, subheader2</code>
::; above : Text to put within the uppermost cell of the table, below the title.
:: additional title fields which fit below <code>above</code>.
::; subheader, subheader2 : Additional title fields which fit below <code>above</code>.
: <code>image, image2</code>
::; image, image2 : Images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default.
:: images to display at the top of the template. Use full image syntax, for example <nowiki>[[File:example.png|200px|alt=Example alt text]]</nowiki>. Image is centered by default.
::; caption, caption2 : Text to put underneath the images.
: <code>caption, caption2</code>
 
:: Text to put underneath the images.
:: For the following parameters <''n''> is a '''position number''' for the row, that is shared for <code>header</code> and <code>label/data</code> rows. <''n''> does not have to be continuous but <code>header</code> and <code>label/data</code> rows show up in numerical order, regardless of the order in which they appear in the source.
; Row parameters
::; header<''n''> : Text to use as a header in row <''n''>.  
A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a parameter that defaults to an empty string, like so:
::A row with a label but no data is not displayed. This allows for the easy creation of optional infobox content rows. To make a row optional use a <code>data</code>parameter that defaults to an empty string, i.e. <code><nowiki>data5=&nbsp;{{{population|}}}</nowiki></code>
<pre>label5 = Population
::; label<''n''> : Text to use as a label in row <''n''>.
|data5 = {{{population|}}}
::; data<''n''> : Text to display as data in row <''n''>.
</pre>
 
: <code>header<sub>n</sub></code>
:; Parameters (style)
:: Text to use as a header in row n.
::; bodystyle : Applies to the infobox as a whole
: <code>label<sub>n</sub></code>
::; abovestyle : Applies only to the <code>above</code> cell at the top.
:: Text to use as a label in row n.
::; imagestyle : Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
: <code>data<sub>n</sub></code>
::; captionstyle : Applies to the text of the image caption.
:: Text to display as data in row n.
::; headerstyle : Applies to all header rows
; Style parameters
::; labelstyle : Applies to all label cells
: <code>bodystyle</code>
::; datastyle : Applies to all data cells
:: Applies to the infobox table as a whole
: <code>abovestyle</code>
:: Applies only to the <code>above</code> cell at the top.
: <code>imagestyle</code>
:: Applies to the cell the image is in. This includes the text of the image caption, but you should set text properties with captionstyle instead of imagestyle in case the caption is moved out of this cell in the future.
: <code>captionstyle</code>
:: Applies to the text of the image caption.
: <code>headerstyle</code>
:: Applies to all header cells
: <code>labelstyle</code>
:: Applies to all label cells
: <code>datastyle</code>
:: Applies to all data cells


;Sample output
;Sample output
{{Code|<nowiki>{{Infobox
{{Infobox
|name        = {{subst:PAGENAME}}
|name        = Infobox/doc


|title        = Test Infobox
|title        = Test Infobox title
|above        = Above text
|above        = Above text
|subheader    = Subheader above image
|subheader    = Subheader above image
Line 102: Line 97:


|header1 = Header defined alone
|header1 = Header defined alone
|label1  =
|label2  =  
|data1  =
|header2 =
|label2  = Label defined alone does not display (needs data, or is suppressed)
|data2  =  
|data2  =  
|header3 =
|header3 =  
|label3 =  
|label4 = Label defined alone does not display (needs data, or is suppressed)
|data3  = Data defined alone
|data4  =  
|header4 = All three defined (header, label, data, all with same number)
|label4  = does not display (same number as a header)
|data4  = does not display (same number as a header)
|header5 =
|header5 =
|label5 = Label and data defined (label)
|label6 =
|data5   = Label and data defined (data)
|data6  = Data defined alone, takes up the whole width of the box.
|header7 = All three defined (header, label, data, all with same position number)
|label7  = does not display (same position number as a header)
|data7  = does not display (same position number as a header)
|header9 =
|label10 = Label and data defined (label)
|data10  = Label and data defined (data)
|label9  = Label 9 and data defined, but out of order in source (label but out of order in source)
|data9   = Label and data defined (data but out of order in source)
|below  = Below text
}}
{{Code|<nowiki>{{Infobox
|name        = {{subst:PAGENAME}}


|below      = Below text
|title        = Test Infobox title
}}</nowiki>}} gives...
{{Infobox
|name        = Infobox/doc
 
|title        = Test Infobox
|above        = Above text
|above        = Above text
|subheader    = Subheader above image
|subheader    = Subheader above image
Line 131: Line 127:


|header1 = Header defined alone
|header1 = Header defined alone
|label1  =
|label2  = <!-- No content in label and data, does not display -->
|data1  =
|header2 =
|label2  = Label defined alone does not display (needs data, or is suppressed)
|data2  =  
|data2  =  
|header3 =
|header3 =  
|label3 =  
|label4 = Label defined alone does not display (needs data, or is suppressed)
|data3  = Data defined alone
|data4  =  
|header4 = All three defined (header, label, data, all with same number)
|label4  = does not display (same number as a header)
|data4  = does not display (same number as a header)
|header5 =
|header5 =
|label5 = Label and data defined (label)
|label6 =
|data5   = Label and data defined (data)
|data6  = Data defined alone, takes up the whole width of the box.
|header7 = All three defined (header, label, data, all with same number)
|label7  = does not display (same number as a header)
|data7  = does not display (same number as a header)
|label10 = Label 10 and data defined (label)
|data10  = Label and data defined (data)
|label9  = Label 9 and data defined, but out of order in source (label)
|data9   = Label and data defined (data but out of order in source)
|below      = Below text
}}</nowiki>}} gives...


|below      = Below text
}}


; See also:
; See also:
Line 153: Line 150:
:* [[Template:InfoboxContainerCSS]]
:* [[Template:InfoboxContainerCSS]]


<includeonly>[[Category:Infobox templates]]<!-- Any categories for the template itself --></includeonly>
<includeonly>[[Category:Infobox templates| ]]<!-- The space sortkey makes it to sort before the alphabetical sort --><!-- Any categories for the template itself --></includeonly>
<noinclude>[[Category:Template documentation]]</noinclude>
<noinclude>[[Category:Template documentation]]</noinclude>