Template:Infobox3cols/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{template rating|p}}
{{Lua|Module:Infobox3cols}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->


This is a fork of {{tl|infobox}} which provides an option for up to three <code>data</code> attributes per row, in addition to a label: data''x''a, data''x''b and data''x''c.
This is a fork of {{tl|infobox}} which provides an option for up to three {{code|data}} attributes per row, in addition to a label: data''x''a, data''x''b and data''x''c.


{{clear}}
{{clear}}
== Usage ==
== Usage ==
<pre>
{{Pre|width=25%|
{{Infobox3cols
{{{{fcb|#4169e1|Infobox3cols}}
| child =  
  | {{fcb|#2e8b57|name}}      =
| bodyclass =  
  | {{fcb|#2e8b57|child}}    =  
| bodystyle =  
  | {{fcb|#2e8b57|bodyclass}} =  
| title =  
  | {{fcb|#2e8b57|bodystyle}} =  
| titleclass =  
 
| titlestyle =  
  | {{fcb|#2e8b57|title}}      =  
| above =  
  | {{fcb|#2e8b57|titleclass}} =  
| abovestyle =  
  | {{fcb|#2e8b57|titlestyle}} =  
| aboveclass =  
 
| aboverowclass =  
  | {{fcb|#2e8b57|above}}        =  
| subheader =  
  | {{fcb|#2e8b57|abovestyle}}    =  
| subheaderstyle =  
  | {{fcb|#2e8b57|aboveclass}}    =  
| subheaderclass =  
  | {{fcb|#2e8b57|aboverowclass}} =  
| subheaderrowclass1 =  
 
| subheader2 =  
  | {{fcb|#2e8b57|subheader}}          =  
| subheaderrowclass2 =  
  | {{fcb|#2e8b57|subheaderstyle}}    =  
| image =  
  | {{fcb|#2e8b57|subheaderclass}}    =  
| image1 =  
  | {{fcb|#2e8b57|subheaderrowclass1}} =  
| caption =  
  | {{fcb|#2e8b57|subheader2}}        =  
| caption1 =  
  | {{fcb|#2e8b57|subheaderrowclass2}} =  
| captionstyle =  
 
| imagestyle =  
  | {{fcb|#2e8b57|image}}          =  
| imageclass =  
  | {{fcb|#2e8b57|image1}}        =  
| imagerowclass1 =  
  | {{fcb|#2e8b57|caption}}        =  
| image2 =  
  | {{fcb|#2e8b57|caption1}}      =  
| caption2 =  
  | {{fcb|#2e8b57|captionstyle}}  =  
| imagerowclass2 =  
  | {{fcb|#2e8b57|imagestyle}}    =  
  | {{fcb|#2e8b57|imageclass}}    =  
  | {{fcb|#2e8b57|imagerowclass1}} =  
  | {{fcb|#2e8b57|image2}}        =  
  | {{fcb|#2e8b57|caption2}}      =  
  | {{fcb|#2e8b57|imagerowclass2}} =
 
  | {{fcb|#2e8b57|headerstyle}}  =
  |  {{fcb|#2e8b57|labelstyle}}  =
  |  {{fcb|#2e8b57|datastyle}}  =
  |  {{fcb|#2e8b57|datastylea}} =
  |  {{fcb|#2e8b57|datastyleb}} =
  |  {{fcb|#2e8b57|datastylec}} =  


| headerstyle =  
  | {{fcb|#2e8b57|header1}}    =
| labelstyle =  
  |  {{fcb|#2e8b57|label1}}    =
| datastyle =  
  |  {{fcb|#2e8b57|data1}}    =  
| datastylea =  
  |  {{fcb|#2e8b57|data1a}}  =  
| datastyleb =  
  |  {{fcb|#2e8b57|data1b}}  =  
| datastylec =  
  |   {{fcb|#2e8b57|data1c}}  =  
  | {{fcb|#2e8b57|class1}}    =  
  |  {{fcb|#2e8b57|rowclass1}} =  


| header1 =  
  | {{fcb|#2e8b57|header2}}    =  
| label1 =  
  |  {{fcb|#2e8b57|rowclass2}} =  
| data1 =  
  |  {{fcb|#2e8b57|label2}}    =  
| data1a =  
  |  {{fcb|#2e8b57|data2}}    =  
| data1b =  
  |  {{fcb|#2e8b57|class2}}    =  
| data1c =  
  |  {{fcb|#2e8b57|data2a}}  =  
| class1 =  
  |  {{fcb|#2e8b57|data2b}}  =  
| rowclass1 =  
  |  {{fcb|#2e8b57|class2a}}  =
  |  {{fcb|#2e8b57|class2b}}  =
  |  {{fcb|#2e8b57|class2c}}  =
  |  {{fcb|#2e8b57|data2c}}  =  


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


...
  | {{fcb|#2e8b57|below}}        =
  | {{fcb|#2e8b57|belowstyle}}    =
  | {{fcb|#2e8b57|belowclass}}    =
  | {{fcb|#2e8b57|belowrowclass}} =


| below =
}} }}
| belowstyle =
| belowclass =
| belowrowclass =
| name =
}}
</pre>


== Parameter precedence ==
== Parameter Precedence ==
The bulk of the infobox is generated by blocks of numbered parameters: <code>headerX</code>, <code>labelX</code>, <code>dataX</code>, <code>dataXa</code>, <code>dataXb</code>, and <code>dataXc</code>. The following examples demonstrate the order in which these parameters are used.
The bulk of the infobox is generated by blocks of numbered parameters: {{code|headerX}}, {{code|labelX}}, {{code|dataX}}, {{code|dataXa}}, {{code|dataXb}}, and {{code|dataXc}}. The following examples demonstrate the order in which these parameters are used.


{|
{|
|+ Example 1
|+ '''Example 1'''
! Code !! Result
! Code !! Result
|- style="vertical-align:top"
|- style="vertical-align:top"
|<pre>
{{infobox3cols
| header1 = header1
| label1 = label1
| data1 = data1
| data1a = data1a
| data1b = data1b
| data1c = data1c
}}</pre>
|
|
{{infobox3cols
{{Pre|
| header1 = header1
{{{{fcb|#4169e1|Infobox3cols}}
| label1 = label1
  <nowiki>|</nowiki> {{fcb|#2e8b57|header1}}    = {{fc|#933|header1}}
| data1 = data1
  <nowiki>|</nowiki>  {{fcb|#2e8b57|label1}}    = {{fc|#933|label1}}
| data1a = data1a
  <nowiki>|</nowiki>  {{fcb|#2e8b57|data1}}    = {{fc|#933|data1}}
| data1b = data1b
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1a}}  = {{fc|#933|data1a}}
| data1c = data1c
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1b}}  = {{fc|#933|data1b}}
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1c}}  = {{fc|#933|data1c}}
}} }}
|
{{Infobox3cols
  | header1 = header1
  | label1 = label1
  | data1 = data1
  | data1a = data1a
  | data1b = data1b
  | data1c = data1c
}}
}}
|}
|}


{|
{|
|+ Example 2
|+ '''Example 2'''
! Code !! Result
! Code !! Result
|- style="vertical-align:top"
|- style="vertical-align:top"
|<pre>
|
{{infobox3cols
{{Pre|
| header1 =  
{{{{fcb|#4169e1|Infobox3cols}}
| label1 = label1
  <nowiki>|</nowiki> {{fcb|#2e8b57|header1}}  =  
| data1 = data1
  <nowiki>|</nowiki>  {{fcb|#2e8b57|label1}}  = {{fc|#933|label1}}
| data1a = data1a
  <nowiki>|</nowiki>  {{fcb|#2e8b57|data1}}  = {{fc|#933|data1}}
| data1b = data1b
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1a}} = {{fc|#933|data1a}}
| data1c = data1c
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1b}} = {{fc|#933|data1b}}
}}</pre>
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1c}} = {{fc|#933|data1c}}
}} }}
|
|
{{infobox3cols
{{infobox3cols
| header1 =  
  | header1 =  
| label1 = label1
  | label1 = label1
| data1 = data1
  | data1 = data1
| data1a = data1a
  | data1a = data1a
| data1b = data1b
  | data1b = data1b
| data1c = data1c
  | data1c = data1c
}}
}}
|}
|}


{|
{|
|+ Example 3
|+ '''Example 3'''
! Code !! Result
! Code !! Result
|- style="vertical-align:top"
|- style="vertical-align:top"
|<pre>
|
{{infobox3cols
{{Pre|
| header1 =  
{{{{fcb|#4169e1|Infobox3cols}}
| label1 =  
  <nowiki>|</nowiki> {{fcb|#2e8b57|header1}}  =  
| data1 = data1
  <nowiki>|</nowiki>  {{fcb|#2e8b57|label1}}  =
| data1a = data1a
  <nowiki>|</nowiki>  {{fcb|#2e8b57|data1}}  = {{fc|#933|data1}}
| data1b = data1b
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1a}} = {{fc|#933|data1a}}
| data1c = data1c
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1b}} = {{fc|#933|data1b}}
}}</pre>
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1c}} = {{fc|#933|data1c}}
}} }}
|
|
{{infobox3cols
{{infobox3cols
| header1 =  
  | header1 =  
| label1 =  
  | label1 =  
| data1 = data1
  | data1 = data1
| data1a = data1a
  | data1a = data1a
| data1b = data1b
  | data1b = data1b
| data1c = data1c
  | data1c = data1c
}}
}}
|}
|}


{|
{|
|+ Example 4
|+ '''Example 4'''
! Code !! Result
! Code !! Result
|- style="vertical-align:top"
|- style="vertical-align:top"
|<pre>
|
{{infobox3cols
{{Pre|
| header1 =  
{{{{fcb|#4169e1|Infobox3cols}}
| label1 = label1
  <nowiki>|</nowiki> {{fcb|#2e8b57|header1}}    =  
| data1 =  
  <nowiki>|</nowiki>  {{fcb|#2e8b57|label1}}    = {{fc|#933|label1}}
| data1a = data1a
  <nowiki>|</nowiki>  {{fcb|#2e8b57|data1}}    =  
| data1b = data1b
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1a}}  = {{fc|#933|data1a}}
| data1c = data1c
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1b}}  = {{fc|#933|data1b}}
}}</pre>
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1c}}  = {{fc|#933|data1c}}
}} }}
|
|
{{infobox3cols
{{infobox3cols
| header1 =  
  | header1 =  
| label1 = label1
  | label1 = label1
| data1 =  
  | data1 =  
| data1a = data1a
  | data1a = data1a
| data1b = data1b
  | data1b = data1b
| data1c = data1c
  | data1c = data1c
}}
}}
|}
|}


{|
{|
|+ Example 5
|+ '''Example 5'''
! Code !! Result
! Code !! Result
|- style="vertical-align:top"
|- style="vertical-align:top"
|<pre>
|
{{infobox3cols
{{Pre|
| header1 =  
{{{{fcb|#4169e1|Infobox3cols}}
| label1 = label1
  <nowiki>|</nowiki> {{fcb|#2e8b57|header1}}    =  
| data1 =  
  <nowiki>|</nowiki>  {{fcb|#2e8b57|label1}}    = {{fc|#933|label1}}
| data1a =  
  <nowiki>|</nowiki>  {{fcb|#2e8b57|data1}}    =  
| data1b = data1b
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1a}}  =  
| data1c = data1c
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1b}}  = {{fc|#933|data1b}}
}}</pre>
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1c}}  = {{fc|#933|data1c}}
}} }}
|
|
{{infobox3cols
{{infobox3cols
| header1 =  
  | header1 =  
| label1 = label1
  | label1 = label1
| data1 =  
  | data1 =  
| data1a =  
  | data1a =  
| data1b = data1b
  | data1b = data1b
| data1c = data1c
  | data1c = data1c
}}
}}
|}
|}


{|
{|
|+ Example 6
|+ '''Example 6'''
! Code !! Result
! Code !! Result
|- style="vertical-align:top"
|- style="vertical-align:top"
|<pre>
|
{{infobox3cols
{{Pre|
| header1 =  
{{{{fcb|#4169e1|Infobox3cols}}
| label1 = label1
  <nowiki>|</nowiki> {{fcb|#2e8b57|header1}}    =  
| data1 =  
  <nowiki>|</nowiki>  {{fcb|#2e8b57|label1}}    = {{fc|#933|label1}}
| data1a =  
  <nowiki>|</nowiki>  {{fcb|#2e8b57|data1}}    =  
| data1b =  
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1a}}  =  
| data1c = data1c
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1b}}  =  
}}</pre>
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1c}}  = {{fc|#933|data1c}}
}} }}
|
|
{{infobox3cols
{{infobox3cols
| header1 =  
  | header1 =  
| label1 = label1
  | label1 = label1
| data1 =  
  | data1 =  
| data1a =  
  | data1a =  
| data1b =  
  | data1b =  
| data1c = data1c
  | data1c = data1c
}}
}}
|}
|}


{|
{|
|+ Example 7
|+ '''Example 7'''
! Code !! Result
! Code !! Result
|- style="vertical-align:top"
|- style="vertical-align:top"
|<pre>
|
{{infobox3cols
{{Pre|
| header1 =  
{{{{fcb|#4169e1|Infobox3cols}}
| label1 =  
  <nowiki>|</nowiki> {{fcb|#2e8b57|header1}}    =  
| data1 =  
  <nowiki>|</nowiki>  {{fcb|#2e8b57|label1}}    =  
| data1a = data1a
  <nowiki>|</nowiki>  {{fcb|#2e8b57|data1}}    =  
| data1b = data1b
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1a}}  = {{fc|#933|data1a}}
| data1c = data1c
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1b}}  = {{fc|#933|data1b}}
}}</pre>
  <nowiki>|</nowiki>    {{fcb|#2e8b57|data1c}}  = {{fc|#933|data1c}}
}} }}
|
|
{{infobox3cols
{{infobox3cols
| header1 =  
  | header1 =  
| label1 =  
  | label1 =  
| data1 =  
  | data1 =  
| data1a = data1a
  | data1a = data1a
| data1b = data1b
  | data1b = data1b
| data1c = data1c
  | data1c = data1c
}}
}}
|}
|}


<includeonly>{{Sandbox other||
== TemplateDate ==
<templatedata>
{
"description": "This template is intended as a meta template, a template used for constructing other templates. In general, it is not meant for use directly in an article but can be used on a one-off basis if required.",
"format": "{{_\n| ________________ = _\n}}\n",
"params": {
"title": {
"label": "Title",
"description": "Title displayed above the infobox",
"type": "string",
"suggested": true
},
"image": {
"label": "Image",
"description": "Image illustrating the topic.  Use full image syntax.",
"type": "content",
"suggested": true,
"example": "[[File:example.png|200px|alt=Example alt text]]"
},
"caption": {
"label": "Caption",
"description": "caption for the image",
"type": "content",
"suggested": true
}
},
"paramOrder": [
"title",
"image",
"caption"
]
}
</templatedata>
 
 
<includeonly>{{sandbox other||{{testcases other||
 
<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:Utility templates]]
}}</includeonly>
}}}}</includeonly>

Latest revision as of 01:47, 20 August 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.

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
  | name      = 
  | child     = 
  | bodyclass = 
  | bodystyle = 
  
  | title      = 
  | titleclass = 
  | titlestyle = 
  
  | 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 = 

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

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

  | ...

  | below         = 
  | belowstyle    = 
  | belowclass    = 
  | belowrowclass = 

}}

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
}}

TemplateDate

This template is intended as a meta template, a template used for constructing other templates. In general, it is not meant for use directly in an article but can be used on a one-off basis if required.

Template parameters

This template has custom formatting.

ParameterDescriptionTypeStatus
Titletitle

Title displayed above the infobox

Stringsuggested
Imageimage

Image illustrating the topic. Use full image syntax.

Example
[[File:example.png|200px|alt=Example alt text]]
Contentsuggested
Captioncaption

caption for the image

Contentsuggested