Template:Infobox: Difference between revisions

From Pirate Software Wiki
(add an if statement so that rows with labels but no data are hidden by default)
(Trying to implement an modular infobox)
Tag: Replaced
 
(80 intermediate revisions by 24 users not shown)
Line 1: Line 1:
<table class="infobox bordered" style="width: 25em; text-align: left; font-size: 90%; {{{bodystyle|}}}">
<includeonly>{{infobox start|{{{class|}}}}}
<tr><!-- Header
{{infobox header
--><td colspan="2" style="text-align:center; font-size: large; background:#ccf; {{{titlestyle|}}}"><span style="float:right; margin-right:1em;">{{Tnavbar| {{{name}}}|fontstyle={{{titlestyle|}}};border:none;|mini=1}}</span> {{{title}}}</td>
| name = {{{name|{{PAGENAME}}}}}
</tr><!-- Image
| wideimage = {{{image|{{{name|{{PAGENAME}}}}}.png}}}
-->{{#if:{{{image|}}}|<tr>
| description = {{{description|}}}
<td colspan="2" style="text-align:center; {{{imagestyle|}}}"> {{{image}}} {{#if:{{{caption|}}}|<br><span style="{{{captionstyle|}}}">{{{caption}}} }}</span></td>
}}
</tr>}}<!--
Row 1
-->{{#if:{{{header1|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header1}}}</th></tr>| {{#if:{{{label1|}}}|{{#if:{{{data1|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label1}}}</th><td style="{{{datastyle|}}}">{{{data1|}}}</td></tr>}}|  {{#if:{{{data1|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data1|}}}</td></tr>}} }} }}<!--
Row 2
-->{{#if:{{{header2|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header2}}}</th></tr>| {{#if:{{{label2|}}}|{{#if:{{{data2|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label2}}}</th><td style="{{{datastyle|}}}">{{{data2|}}}</td></tr>}}|  {{#if:{{{data2|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data2|}}}</td></tr>}} }} }}<!--
Row 3
-->{{#if:{{{header3|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header3}}}</th></tr>| {{#if:{{{label3|}}}|{{#if:{{{data3|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label3}}}</th><td style="{{{datastyle|}}}">{{{data3|}}}</td></tr>}}|  {{#if:{{{data3|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data3|}}}</td></tr>}} }} }}<!--
Row 4
-->{{#if:{{{header4|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header4}}}</th></tr>| {{#if:{{{label4|}}}|{{#if:{{{data4|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label4}}}</th><td style="{{{datastyle|}}}">{{{data4|}}}</td></tr>}}|  {{#if:{{{data4|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data4|}}}</td></tr>}} }} }}<!--
Row 5
-->{{#if:{{{header5|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header5}}}</th></tr>|  {{#if:{{{label5|}}}|{{#if:{{{data5|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label5}}}</th><td style="{{{datastyle|}}}">{{{data5|}}}</td></tr>}}|  {{#if:{{{data5|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data5|}}}</td></tr>}} }} }}<!--
Row 6
-->{{#if:{{{header6|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header6}}}</th></tr>| {{#if:{{{label6|}}}|{{#if:{{{data6|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label6}}}</th><td style="{{{datastyle|}}}">{{{data6|}}}</td></tr>}}|  {{#if:{{{data6|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data6|}}}</td></tr>}} }} }}<!--
Row 7
-->{{#if:{{{header7|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header7}}}</th></tr>| {{#if:{{{label7|}}}|{{#if:{{{data7|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label7}}}</th><td style="{{{datastyle|}}}">{{{data7|}}}</td></tr>}}|  {{#if:{{{data7|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data7|}}}</td></tr>}} }} }}<!--
Row 8
-->{{#if:{{{header8|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header8}}}</th></tr>| {{#if:{{{label8|}}}|{{#if:{{{data8|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label8}}}</th><td style="{{{datastyle|}}}">{{{data8|}}}</td></tr>}}|  {{#if:{{{data8|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data8|}}}</td></tr>}} }} }}<!--
Row 9
-->{{#if:{{{header9|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header9}}}</th></tr>| {{#if:{{{label9|}}}|{{#if:{{{data9|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label9}}}</th><td style="{{{datastyle|}}}">{{{data9|}}}</td></tr>}}| {{#if:{{{data9|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data9|}}}</td></tr>}} }} }}<!--
Row 10
-->{{#if:{{{header10|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header10}}}</th></tr>| {{#if:{{{label10|}}}|{{#if:{{{data10|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label10}}}</th><td style="{{{datastyle|}}}">{{{data10|}}}</td></tr>}}|  {{#if:{{{data10|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data10|}}}</td></tr>}} }} }}<!--
Row 11
-->{{#if:{{{header11|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header11}}}</th></tr>| {{#if:{{{label11|}}}|{{#if:{{{data11|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label11}}}</th><td style="{{{datastyle|}}}">{{{data11|}}}</td></tr>}}|  {{#if:{{{data11|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data11|}}}</td></tr>}} }} }}<!--
Row 12
-->{{#if:{{{header12|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header12}}}</th></tr>| {{#if:{{{label12|}}}|{{#if:{{{data12|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label12}}}</th><td style="{{{datastyle|}}}">{{{data12|}}}</td></tr>}}|  {{#if:{{{data12|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data12|}}}</td></tr>}} }} }}<!--
Row 13
-->{{#if:{{{header13|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header13}}}</th></tr>| {{#if:{{{label13|}}}|{{#if:{{{data13|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label13}}}</th><td style="{{{datastyle|}}}">{{{data13|}}}</td></tr>}}|  {{#if:{{{data13|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data13|}}}</td></tr>}} }} }}<!--
Row 14
-->{{#if:{{{header14|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header14}}}</th></tr>| {{#if:{{{label14|}}}|{{#if:{{{data14|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label14}}}</th><td style="{{{datastyle|}}}">{{{data14|}}}</td></tr>}}|  {{#if:{{{data14|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data14|}}}</td></tr>}} }} }}<!--
Row 15
-->{{#if:{{{header15|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header15}}}</th></tr>| {{#if:{{{label15|}}}|{{#if:{{{data15|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label15}}}</th><td style="{{{datastyle|}}}">{{{data15|}}}</td></tr>}}|  {{#if:{{{data15|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data15|}}}</td></tr>}} }} }}<!--
Row 16
-->{{#if:{{{header16|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header16}}}</th></tr>| {{#if:{{{label16|}}}|{{#if:{{{data16|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label16}}}</th><td style="{{{datastyle|}}}">{{{data16|}}}</td></tr>}}|  {{#if:{{{data16|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data16|}}}</td></tr>}} }} }}<!--
Row 17
-->{{#if:{{{header17|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header17}}}</th></tr>| {{#if:{{{label17|}}}|{{#if:{{{data17|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label17}}}</th><td style="{{{datastyle|}}}">{{{data17|}}}</td></tr>}}|  {{#if:{{{data17|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data17|}}}</td></tr>}} }} }}<!--
Row 18
-->{{#if:{{{header18|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header18}}}</th></tr>| {{#if:{{{label18|}}}|{{#if:{{{data18|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label18}}}</th><td style="{{{datastyle|}}}">{{{data18|}}}</td></tr>}}|  {{#if:{{{data18|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data18|}}}</td></tr>}} }} }}<!--
Row 19
-->{{#if:{{{header19|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header19}}}</th></tr>| {{#if:{{{label19|}}}|{{#if:{{{data19|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label19}}}</th><td style="{{{datastyle|}}}">{{{data19|}}}</td></tr>}}|  {{#if:{{{data19|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data19|}}}</td></tr>}} }} }}<!--
Row 20
-->{{#if:{{{header20|}}}|<tr><th colspan="2" style="text-align:center; background:#ccf; {{{headerstyle|}}}">{{{header20}}}</th></tr>|  {{#if:{{{label20|}}}|{{#if:{{{data20|}}}|<tr><th style="background:#ddf; {{{labelstyle|}}}">{{{label20}}}</th><td style="{{{datastyle|}}}">{{{data20|}}}</td></tr>}}|  {{#if:{{{data20|}}}|<tr><td colspan="2" style="{{{datastyle|}}}">{{{data20|}}}</td></tr>}} }} }}<!--
Below
-->{{#if:{{{below|}}}|<tr><td colspan="2" style="background:#ddf; text-align:center; font-size:small; font-style:italic; {{{belowstyle|}}}">{{{below|}}}</td></tr>}}
</table><noinclude>
{{pp-template|small=yes}}


{{documentation}}
{{infobox section|{{#if:{{{section1|}}}|{{{section1}}}|Infos}}}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
{{infobox row|{{{info1|}}}|{{{info1value|}}}|{{{info1value|}}}}}
</noinclude>
{{infobox section|{{{section2}}}|{{{section2|}}}}}
{{infobox row|{{{info2|}}}|{{{info2value|}}}|{{{info2value|}}}}}
{{infobox section|{{{section3}}}|{{{section3|}}}}}
{{infobox row|{{{info3|}}}|{{{info3value|}}}|{{{info3value|}}}}}
{{infobox section|{{{section4}}}|{{{section4|}}}}}
{{infobox row|{{{info4|}}}|{{{info4value|}}}|{{{info4value|}}}}}
{{infobox section|{{{section5}}}|{{{section5|}}}}}
{{infobox row|{{{info5|}}}|{{{info5value|}}}|{{{info5value|}}}}}
{{infobox section|{{{section6}}}|{{{section6|}}}}}
{{infobox row|{{{info6|}}}|{{{info6value|}}}|{{{info6value|}}}}}
{{infobox section|{{{section7}}}|{{{section7|}}}}}
{{infobox row|{{{info7|}}}|{{{info7value|}}}|{{{info7value|}}}}}
{{infobox section|{{{section8}}}|{{{section8|}}}}}
{{infobox row|{{{info8|}}}|{{{info8value|}}}|{{{info8value|}}}}}
{{infobox section|{{{section9}}}|{{{section9|}}}}}
{{infobox row|{{{info9|}}}|{{{info9value|}}}|{{{info9value|}}}}}
{{infobox section|{{{section10}}}|{{{section10|}}}}}
{{infobox row|{{{info10|}}}|{{{info10value|}}}|{{{info10value|}}}}}
{{infobox end}}</includeonly><noinclude>
{{doc}}
[[Category:Infobox templates]]</noinclude>

Latest revision as of 15:14, 29 November 2023

Documentation

This is a flexible generic infobox with customize-able fields. It is made using infobox parts. It is intended to be used in situations that require a one-time infobox that is not reused enough for a dedicated template. It is not intended to be a template called to make another infobox template. For information on how to make an infobox using these parts, observe this page's source code or see Template:Infobox example.

Usage

{{infobox
| class = 
| name = 
| image = 
| description = 
| section1 = 
| info1 = 
| info1value = 
| section2 = 
| info2 = 
| info2value = 
| section3 = 
| info3 = 
| info3value = 
| section4 = 
| info4 = 
| info4value = 
| section5 = 
| info5 = 
| info5value = 
| section6 = 
| info6 = 
| info6value = 
| section7 = 
| info7 = 
| info7value = 
}}

Parameters

  • class - Optional. Adds a second class to the infobox, allowing for customizing individual or groups of infoboxes. See Template:Infobox start/doc for more info.
  • image - Images should be formatted as image.jpg. The [[ ]] and File: are not necessary.

Example

Fire
Main Info
Race Plushie
Source Banana
Other Info
Related Fun
{{Infobox
| name       = Fire
| image      = Thor.png
| section1   = Main Info
| info1      = Race
| info1value = Plushie
| info2      = Location
| info2value = 
| info3      = Source
| info3value = Banana
| info4      = Reward
| info4value = 
| section5   = Other Info
| info5      = Related
| info5value = Fun
| info6      = ID
| info6value =
}}