Jump to content

Template:Infobox3cols

From Elite Dangerous Wiki
Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit "Template:Infobox3cols/doc" to edit its documentation if it is available. (How does this work?)

Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab.

This is a fork of {{infobox}} which provides an option for up to three data attributes per row, in addition to a label: dataxa, dataxb and dataxc.

Usage

{{Infobox3cols
| child = 
| bodyclass = 
| bodystyle = 
| title = 
| titleclass = 
| titlestyle = 
| autoheaders = 
| above = 
| abovestyle = 
| aboveclass = 
| aboverowclass = 
| subheader = 
| subheaderstyle = 
| subheaderclass = 
| subheaderrowclass1 = 
| subheader2 = 
| subheaderrowclass2 = 
| image = 
| image1 = 
| caption = 
| caption1 = 
| captionstyle = 
| imagestyle = 
| imageclass = 
| imagerowclass1 = 
| image2 = 
| caption2 = 
| imagerowclass2 = 

| headerstyle = 
| labelstyle = 
| datastyle = 
| datastylea = 
| datastyleb = 
| datastylec = 
| extracellstyles = 1,3a,4b=...

| header1 = 
| label1 = 
| data1 = 
| data1a = 
| data1b = 
| data1c = 
| class1 = 
| rowclass1 = 

| header2 = 
| rowclass2 = 
| label2 = 
| data2 = 
| class2 = 
| data2a = 
| data2b = 
| class2a = 
| class2b = 
| class2c = 
| data2c = 

...

| below = 
| belowstyle = 
| belowclass = 
| belowrowclass = 
| name = 
}}

Parameter precedence

The bulk of the infobox is generated by blocks of numbered parameters: headerX, labelX, dataX, dataXa, dataXb, and dataXc. The following examples demonstrate the order in which these parameters are used.

Example 1
Code Result
{{Infobox3cols
| header1 = header1
| label1 = label1
| data1 = data1
| data1a = data1a
| data1b = data1b
| data1c = data1c
}}
header1
Example 2
Code Result
{{infobox3cols
| header1 = 
| label1 = label1
| data1 = data1
| data1a = data1a
| data1b = data1b
| data1c = data1c
}}
label1 data1
Example 3
Code Result
{{infobox3cols
| header1 = 
| label1 = 
| data1 = data1
| data1a = data1a
| data1b = data1b
| data1c = data1c
}}
data1
Example 4
Code Result
{{infobox3cols
| header1 = 
| label1 = label1
| data1 = 
| data1a = data1a
| data1b = data1b
| data1c = data1c
}}
label1 data1a data1b data1c
Example 5
Code Result
{{infobox3cols
| header1 = 
| label1 = label1
| data1 = 
| data1a = 
| data1b = data1b
| data1c = data1c
}}
label1 data1b data1c
Example 6
Code Result
{{infobox3cols
| header1 = 
| label1 = label1
| data1 = 
| data1a = 
| data1b = 
| data1c = data1c
}}
label1 data1c
Example 7
Code Result
{{infobox3cols
| header1 = 
| label1 = 
| data1 = 
| data1a = data1a
| data1b = data1b
| data1c = data1c
}}

Hiding headers when all its data fields are empty

You can also make headers automatically hide when their section is empty (has no data-row showing).

Consider this situation:

Example: header with & without data
Some attributes
First Unknown
Second Unknown
Third Unknown
Other attributes
{{Infobox
 | title   = Example: header with & without data
 | headerstyle = background: lightgrey; color:inherit;

 | header1 = Header1 with empty section
 |  label2 = label2 text |  data2 =
 |  label3 = label3 text |  data3 =
 |  label4 = label4 text |  data4 =

 | header5 = Header5 with data below
 |  label6 = label6 text |   data6 = Some value

 | header7 = Header7 with unlabeled data8a, data8b, data8c
 |  label8 = 
 | data8a = Some a value
 | data8b = Some b value
 | data8c = Some c value

 | header9 = Header9 with unlabeled data10 below
 |  label10 = 
 |   data10 = Some other value
}}

If you want hide the header when no |dataN= values are present (or only unlabeled |dataNa= and/or |dataNb= and/or |dataNc=), use |autoheaders=y:

Example: header with & without data
Some attributes
First Unknown
Second Unknown
Third Unknown
Other attributes
{{Infobox
 | title   = Example: header with & without data
 | headerstyle = background: lightgrey; color:inherit;
 | autoheaders = y

 | header1 = Header1 with empty section
 |  label2 = label2 text |  data2 =
 |  label3 = label3 text |  data3 =
 |  label4 = label4 text |  data4 =

 | header5 = Header5 with data below
 |  label6 = label6 text |   data6 = Some value

 | header7 = Header7 with unlabeled data8a, data8b, data8c
 |  label8 = 
 | data8a = Some a value
 | data8b = Some b value
 | data8c = Some c value

 | header9 = Header9 with unlabeled data10 below
 |  label10 = 
 |   data10 = Some other value
}}

So, header1 will be shown if any of item1, item2, or item3 is defined. If none of the three parameters are defined the header won't be shown and no empty row appears before the next visible content.

Note: if the data has empty css elements, like |data=<span style="background:yellow;"></span>, this will be treated as non-empty (having data).

If |autoheaders=y but there are items that you do not want to trigger a header, place |headerX=_BLANK_. This will serve as an empty header and separate it from the subsequent items.

Example: header with & without data
Some attributes
First Unknown
Second Unknown
Third Unknown
Other attributes
{{Infobox
 | title   = Example: header with & without data
 | headerstyle = background: lightgrey; color:inherit;
 | autoheaders = y

 | header1 = Header1 with empty section
 |  label2 = label2 text |  data2 =
 |  label3 = label3 text |  data3 =
 |  label4 = label4 text |  data4 =

 | header5 = _BLANK_
 |  label6 = label6 text |   data6 = Some value

 | header7 = Header7 with unlabeled data8a, data8b, data8c
 |  label8 = 
 | data8a = Some a value
 | data8b = Some b value
 | data8c = Some c value

 | header9 = Header9 with unlabeled data10 below
 |  label10 = 
 |   data10 = Some other value
}}

Tracking categories

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Infobox3cols in articles based on its TemplateData.

TemplateData for Infobox3cols