Difference between revisions of "Template:Infobox/doc"

From EVE University Wiki
Jump to: navigation, search
(Docs need updating)
m (Add dependency. Rewrite doc.)
 
(13 intermediate revisions by 2 users not shown)
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:
 +
:; Uses
 +
:: {{T|Infobox/row}}
 +
:; Used by
 +
:: {{T|CMBSiteInfo}}
 +
:: {{T|Infobox agent}}
 +
:: {{T|Infobox coordinator}}
 +
:: {{T|Infobox corporation}}
 +
:: {{T|Infobox gas nebula}}
 +
:: {{T|Infobox Mentors}}
 +
:: {{T|Infobox Mentors Anon}}
 +
:: {{T|Infobox militia}}
 +
:: {{T|Infobox Wiki Supporter}}
 +
:: {{T|HomefrontOperation}}
 +
 
 +
; Syntax
 +
<pre>{{Infobox
 +
| name          = {{subst:PAGENAME}}
 +
| bodystyle      =
 +
 
 +
| titlestyle    =
 +
| abovestyle    =
 +
| subheaderstyle =
 +
| title          =
 +
| above          =
 +
| subheader      =
 +
 
 +
|  imagestyle  =
 +
| captionstyle  =
 +
|  image        =
 +
| caption        =
 +
|  image2      =
 +
| caption2      =
 +
 
 +
| headerstyle    =
 +
|  labelstyle    =
 +
|  datastyle    =
 +
 
 +
| header1  =
 +
 
 +
|  label2  =
 +
|   data2  =
 +
 
 +
| header3  =
 +
 
 +
|  label4  =
 +
|  data4  =
 +
...
 +
| header20 =
 +
 
 +
|  label21 =
 +
|  data21 =
 +
 
 +
| belowstyle    =
 +
| below          =
 +
}}</pre>
 +
 
 +
:; 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. It must be written exactly as the name of the template.
 +
:; Parameters (data)
 +
:: Parameters left empty will not be displayed
 +
::; title : Infobox title
 +
::; above : Text to put within the uppermost cell of the table, below the title.
 +
::; subheader, subheader2 : Additional title fields which fit below <code>above</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.
 +
::; caption, caption2 : 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.
 +
::; 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 <code>data</code>parameter that defaults to an empty string, i.e. <code><nowiki>data5=&nbsp;{{{population|}}}</nowiki></code>
 +
::; label<''n''> : Text to use as a label in row <''n''>.
 +
::; data<''n''> : Text to display as data in row <''n''>.
 +
 
 +
:; Parameters (style)
 +
::; bodystyle : Applies to the infobox as a whole
 +
::; abovestyle : Applies only to the <code>above</code> 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 rows
 +
::; labelstyle : Applies to all label cells
 +
::; datastyle :: Applies to all data cells
 +
 
 +
;Sample output
 +
{{Infobox
 +
|name        = Infobox/doc
 +
 
 +
|title        = Test Infobox title
 +
|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
 +
|label2  =
 +
|data2  =
 +
|header3 =
 +
|label4  = Label defined alone does not display (needs data, or is suppressed)
 +
|data4  =
 +
|header5 =
 +
|label6  =
 +
|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}}
 +
 
 +
|title        = Test Infobox title
 +
|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
 +
|label2  = <!-- No content in label and data, does not display -->
 +
|data2  =
 +
|header3 =
 +
|label4  = Label defined alone does not display (needs data, or is suppressed)
 +
|data4  =
 +
|header5 =
 +
|label6  =
 +
|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...
 +
 
 +
 
 +
; See also:
 +
:* [[wikipedia:Template:Infobox|Wikipedia Template:Infobox]]
 +
:* [[Template:InfoboxContainerCSS]]
 +
 
 +
<includeonly>[[Category:Infobox templates]]<!-- Any categories for the template itself --></includeonly>
 
<noinclude>[[Category:Template documentation]]</noinclude>
 
<noinclude>[[Category:Template documentation]]</noinclude>

Latest revision as of 17:25, 15 June 2023

Description
This template is intended as a meta template: a template used for constructing other Infobox templates.
Dependencies
Uses
{{Infobox/row}}
Used by
{{CMBSiteInfo}}
{{Infobox agent}}
{{Infobox coordinator}}
{{Infobox corporation}}
{{Infobox gas nebula}}
{{Infobox Mentors}}
{{Infobox Mentors Anon}}
{{Infobox militia}}
{{Infobox Wiki Supporter}}
{{HomefrontOperation}}
Syntax
{{Infobox
| name           = {{subst:PAGENAME}}
| bodystyle      = 

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

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

| headerstyle    = 
|  labelstyle    = 
|   datastyle    = 

| header1  = 

|  label2  = 
|   data2  = 

| header3  = 

|  label4  = 
|   data4  = 
...
| header20 = 

|  label21 = 
|   data21 = 

| 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. It must be written exactly as the name of the template.
Parameters (data)
Parameters left empty will not be displayed
title
Infobox title
above
Text to put within the uppermost cell of the table, below the title.
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.
For the following parameters <n> is a position number for the row, that is shared for header and label/data rows. <n> does not have to be continuous but header and label/data rows show up in numerical order, regardless of the order in which they appear in the source.
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 dataparameter that defaults to an empty string, i.e. data5= {{{population|}}}
label<n>
Text to use as a label in row <n>.
data<n>
Text to display as data in row <n>.
Parameters (style)
bodystyle
Applies to the infobox 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 rows
labelstyle
Applies to all label cells
datastyle
: Applies to all data cells
Sample output
Test Infobox title
Above text
Subheader above image
Second subheader
Example alt text
Caption displayed below Example-serious.jpg
Header defined alone
Data defined alone, takes up the whole width of the box.
All three defined (header, label, data, all with same position number)
Label 9 and data defined, but out of order in source (label but out of order in source) Label and data defined (data but out of order in source)
Label and data defined (label) Label and data defined (data)
Below text
{{Infobox |name = {{subst:PAGENAME}} |title = Test Infobox title |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 |label2 = <!-- No content in label and data, does not display --> |data2 = |header3 = |label4 = Label defined alone does not display (needs data, or is suppressed) |data4 = |header5 = |label6 = |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 }}

gives...


See also