Template:Infobox: Difference between revisions

From The Robot's Guide to Humanity
Created page with "<!-- Template:Infobox --> <includeonly> {{#invoke:Infobox|infobox}} </includeonly> <noinclude> This template is a meta-template used to build Infoboxes. It relies on Lua-based modules and acts as a core infobox wrapper. == Usage == To use this template, call it from another template that sets the parameters. For instance, within another template: <nowiki>{{Infobox |name = Example |image = Example.jpg |caption = This is an example infobox |... }}</nowiki> == See also =..."
 
m Protected "Template:Infobox" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<!-- Template:Infobox -->
<!-- Template:Infobox -->
<includeonly>
<includeonly>
{{#invoke:Infobox|infobox}}
{| class="infobox" style="width:22em; border:1px solid #aaa; background:#f9f9f9; font-size:90%;"
|-
! colspan="2" style="text-align:center; background:#f2f2f2; font-size:110%;" | {{{name|}}}
{{#invoke:NoCategory|nop}}<!-- Just a placeholder if needed, remove if not applicable -->
|-
<!-- Image row -->
{{#if:{{{image|}}}
| {{!}} colspan="2" style="text-align:center;" | [[File:{{{image}}}|200px|{{{caption|}}}]]
}}
{{#if:{{{caption|}}}
| {{!}}-
{{!}} colspan="2" style="text-align:center; font-style:italic;" | {{{caption}}}
}}
 
<!-- Additional fields: only display a row if the parameter is provided -->
{{#if:{{{label1|}}}{{{data1|}}}
| {{!}}-
{{!}} style="text-align:left; background:#f2f2f2;"| {{{label1}}}
{{!}} {{{data1}}}
}}
{{#if:{{{label2|}}}{{{data2|}}}
| {{!}}-
{{!}} style="text-align:left;"| {{{label2}}}
{{!}} {{{data2}}}
}}
{{#if:{{{label3|}}}{{{data3|}}}
| {{!}}-
{{!}} style="text-align:left; background:#f2f2f2;"| {{{label3}}}
{{!}} {{{data3}}}
}}
{{#if:{{{label4|}}}{{{data4|}}}
| {{!}}-
{{!}} style="text-align:left;"| {{{label4}}}
{{!}} {{{data4}}}
}}
{{#if:{{{label5|}}}{{{data5|}}}
| {{!}}-
{{!}} style="text-align:left; background:#f2f2f2;"| {{{label5}}}
{{!}} {{{data5}}}
}}
{{#if:{{{label6|}}}{{{data6|}}}
| {{!}}-
{{!}} style="text-align:left;"| {{{label6}}}
{{!}} {{{data6}}}
}}
{{#if:{{{label7|}}}{{{data7|}}}
| {{!}}-
{{!}} style="text-align:left; background:#f2f2f2;"| {{{label7}}}
{{!}} {{{data7}}}
}}
{{#if:{{{label8|}}}{{{data8|}}}
| {{!}}-
{{!}} style="text-align:left;"| {{{label8}}}
{{!}} {{{data8}}}
}}
{{#if:{{{label9|}}}{{{data9|}}}
| {{!}}-
{{!}} style="text-align:left; background:#f2f2f2;"| {{{label9}}}
{{!}} {{{data9}}}
}}
{{#if:{{{label10|}}}{{{data10|}}}
| {{!}}-
{{!}} style="text-align:left;"| {{{label10}}}
{{!}} {{{data10}}}
}}
 
|} <!-- end table -->
</includeonly>
</includeonly>
<noinclude>
<noinclude>
This template is a meta-template used to build Infoboxes. It relies on Lua-based modules and acts as a core infobox wrapper.
This is a basic Infobox template. Use parameters as needed.


== Usage ==
== Usage ==
To use this template, call it from another template that sets the parameters. For instance, within another template:
<nowiki>{{Infobox
<nowiki>{{Infobox
|name = Example
| name =  
|image = Example.jpg
| image =  
|caption = This is an example infobox
| caption =  
|...  
| label1 =
| data1 =
| label2 =
| data2 =
| ...
}}</nowiki>
}}</nowiki>


== See also ==
Add as many label/data pairs as needed.
* [[Help:Infobox]] – General instructions on using infoboxes.
* [[:Category:Infobox templates]] – For more infobox templates.
</noinclude>
</noinclude>

Latest revision as of 19:24, 6 December 2024


This is a basic Infobox template. Use parameters as needed.

Usage

{{Infobox | name = | image = | caption = | label1 = | data1 = | label2 = | data2 = | ... }}

Add as many label/data pairs as needed.