Difference between revisions of "Template:Infobox/doc"

From EVE University Wiki
Jump to: navigation, search
(Docs need updating)
(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>

Revision as of 17:34, 11 May 2022

Description
This template is intended as a meta template: a template used for constructing other.
Dependencies
Syntax
{{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          = 
}}
Parameters
name
If this parameter is present, "view/discuss/edit" links will be added to the bottom of the infobox, pointing to the named template.
above
Text to put within the uppermost cell of the table.
subheader, subheader2
additional title fields which fit below above.
image, image2
images to display at the top of the template. Use full image syntax, for example [[File:example.png|200px|alt=Example alt text]]. Image is centered by default.
caption, caption2
Text to put underneath the images.
headern
Text to use as a header in row n.
labeln
Text to use as a label in row n.
datan
Text to display as data in row n.
bodystyle
Applies to the infobox table as a whole
abovestyle
Applies only to the above cell at the top.
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.
captionstyle
Applies to the text of the image caption.
headerstyle
Applies to all header cells
labelstyle
Applies to all label cells
datastyle
Applies to all data cells
Sample output
{{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
}}
gives...
Test Infobox
Above text
Subheader above image
Second subheader
Example alt text
Caption displayed below Example-serious.jpg
Header defined alone
Data defined alone
All three defined (header, label, data, all with same number)
Label and data defined (label) Label and data defined (data)
Below text
See also