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
Arin Mara (talk | contribs)
Docs need updating
Arin Mara (talk | contribs)
Wrote Infobox docs
Line 1: Line 1:
{{update|Documentation needs to be formated. See [https://en.wikipedia.org/wiki/Template:Infobox Template:Infobox on Wikipedia]}}
;Description
This template serves as a base template for various infobox templates used on the UniWiki.
:This template is intended as a meta template: a template used for constructing other [[Category:Infobox templates|Infobox templates]].
<includeonly>[[Category:Infobox templates]]</includeonly>
;Dependencies:
<noinclude>[[Category:Template documentation]]</noinclude>
:* [[Template:Infobox/row]]
;Syntax
<pre>{{Infobox
| name          = {{subst:PAGENAME}}
| bodystyle      =
 
| titlestyle    =
| abovestyle    =
| subheaderstyle =
| title          =
| above          =
| subheader      =
 
|   imagestyle  =
| captionstyle  =
|  image        =
| caption        =
|  image2      =
| caption2      =
 
| headerstyle    =
|  labelstyle    =
|  datastyle    =
 
| header1  =
|  label1  =
|  data1  =
| header2  =
|  label2  =
|  data2  =
...
| header20 =
|  label20 =
|  data20 =
 
| belowstyle    =
| below          =
}}</pre>
; Parameters
: <code>name</code>
:: If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named template.
: <code>above</code>
:: Text to put within the uppermost cell of the table.
: <code>subheader, subheader2</code>
:: additional title fields which fit below <code>above</code>.
: <code>image, image2</code>
:: 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.
: <code>caption, caption2</code>
:: Text to put underneath the images.
: <code>header<sub>n</sub></code>
:: Text to use as a header in row n.
: <code>label<sub>n</sub></code>
:: Text to use as a label in row n.
: <code>data<sub>n</sub></code>
:: Text to display as data in row n.
: <code>bodystyle</code>
:: 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
<pre>{{Infobox
|name        = {{subst:PAGENAME}}
 
|title        = Test Infobox
|above        = Above text
|subheader    = Subheader above image
|subheader2  = Second subheader
 
|image        = [[File:E-UNI White.png|200px|alt=Example alt text]]
|caption      = Caption displayed below Example-serious.jpg
 
|header1 = Header defined alone
|label1  =
|data1  =
|header2 =
|label2  = Label defined alone does not display (needs data, or is suppressed)
|data2  =
|header3 =
|label3  =
|data3  = Data defined alone
|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 =
|label5  = Label and data defined (label)
|data5  = Label and data defined (data)
 
|below      = Below text
}}</pre>
::gives...
{{Infobox
|name        = Infobox/doc
 
|title        = Test Infobox
|above        = Above text
|subheader    = Subheader above image
|subheader2  = Second subheader
 
|image        = [[File:E-UNI White.png|200px|alt=Example alt text]]
|caption      = Caption displayed below Example-serious.jpg
 
|header1 = Header defined alone
|label1  =
|data1  =
|header2 =
|label2  = Label defined alone does not display (needs data, or is suppressed)
|data2  =
|header3 =
|label3  =
|data3  = Data defined alone
|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 =
|label5  = Label and data defined (label)
|data5  = Label and data defined (data)
 
|below      = Below text
}}
;See also:
:* [[Template:Infobox/row]]
:* [https://en.wikipedia.org/wiki/Template:Infobox Wikipedia Template:Infobox]
 
<includeonly>[[Category:Infobox templates|{{PAGENAME}}]]<!-- Any categories for the template itself --></includeonly>
<noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude>