Template:Infobox: Difference between revisions

From Fancade Wiki
(Increase flexibility, and document template)
m (Resize default image size)
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
   {{#if:{{{title|}}}|<div class="infobox-title">{{{title}}}</div>}}
   {{#if:{{{title|}}}|<div class="infobox-title">{{{title}}}</div>}}
   <div class="infobox-content">{{
   <div class="infobox-content">{{
     #if:{{{image|{{{image_url|}}}}}}|<div class="infobox-image">{{{image_url|[[File:{{{image}}}|250px|alt={{{image_alt|{{{image}}}}}}]]}}}</div>}}{{
     #if:{{{image|{{{image_url|}}}}}}|<div class="infobox-image">{{{image_url|[[File:{{{image}}}|256px|alt={{{image_alt|{{{image}}}}}}]]}}}</div>}}{{
     #if:{{{caption|}}}|<div class="infobox-caption">{{{caption}}}</div>}}<table class="infobox-table">{{
     #if:{{{caption|}}}|<div class="infobox-caption">{{{caption}}}</div>}}<table class="infobox-table">{{
       #if:{{{header1|}}}|<tr class="infobox-header"><th colspan="2">{{{header1}}}</th></tr>}}{{
       #if:{{{header1|}}}|<tr class="infobox-header"><th colspan="2">{{{header1}}}</th></tr>}}{{
Line 23: Line 23:
       #if:{{{data9|}}}|<tr class="infobox-row">{{#if:{{{label9|}}}|<td class="infobox-label">{{{label9}}}</td>}}<td class="infobox-data" {{#if:{{{label9|}}}||colspan="2"}}>{{{data9}}}</td></tr>}}</table>
       #if:{{{data9|}}}|<tr class="infobox-row">{{#if:{{{label9|}}}|<td class="infobox-label">{{{label9}}}</td>}}<td class="infobox-data" {{#if:{{{label9|}}}||colspan="2"}}>{{{data9}}}</td></tr>}}</table>
   </div>
   </div>
</div></includeonly><noinclude>
</div></includeonly><noinclude>{{Documentation}}</noinclude>
 
Generic template for creating infoboxes.
Please use [[:Category:Infoboxes|other infoboxes]] when possible.
 
== Example ==
 
{{Infobox
|title=Odd Bot
|image=Odd Bot.png
|caption=caption
|header1=header1
|label1=label1
|data1=data1
|data2=data2
}}
 
<pre>
{{Infobox
|title=Odd Bot
|image=Odd Bot.png
|caption=caption
|header1=header1
|label1=label1
|data1=data1
|data2=data2
}}
</pre>
 
== Parameters ==
 
Keywords, where (n) is an integer from 1 to 9:
 
* '''title''': Title for the infobox.
* '''image_url''': Image to be displayed as full syntax.
* '''image''': Name of the image. A simpler version of '''image_url''' parameter.
:* '''image_alt''': Alternative text to provide the image.
* '''caption''': Caption for the image.
* '''header(n)'''.
* '''label(n)''': May be omitted.
* '''data(n)'''.
 
[[Category:Infoboxes| ]]
</noinclude>

Latest revision as of 06:26, 8 January 2026

Description

Generic template for creating infoboxes. Please use other infoboxes when possible.

Example

Odd Bot
Odd Bot.png
caption
header1
label1data1
data2
{{Infobox
|title=Odd Bot
|image=Odd Bot.png
|caption=caption
|header1=header1
|label1=label1
|data1=data1
|data2=data2
}}

Parameters

Keywords, where # is an integer from 1 to 9:

  • title: Title for the infobox.
  • image_url: Image to be displayed as full syntax.
  • image: Name of the image. A simpler version of image_url parameter.
  • image_alt: Alternative text to provide the image.
  • caption: Caption for the image.
  • header#.
  • label#: May be omitted.
  • data#.