User:AndreasBlixt/Sandbox/Infobox template

From Wikipedia, the free encyclopedia

This template is used for greatly simplifying the creation of infoboxes. The user may define background and border colors, some general values (such as title, image, etc) and up to 20 field name/field value sets. See the talk page for examples.

Contents

[edit] Parameters

All parameters are optional, and the template could be called simply as {{User:AndreasBlixt/Sandbox/Infobox template}}. However, in most (if not all) cases, the user will want to specify at least a few parameters.

background
The color of the background. Defaults to #f9f9f9 if omitted.
border
The color of the border. Defaults to #aaa if omitted.
float
How the infobox should float relative to the content. Values that can be used are left, right and none. Defaults to right if omitted.
title
The title of the infobox. Hidden if omitted.
image
An image which will be resized to be 200 pixels wide. Hidden if omitted.
imagetitle
The tooltip text which appears when the image is hovered. Defaults to imagedesc when omitted or to image if imagedesc is also omitted.
imagedesc
A description of the image which will appear centered directly below it. Hidden if omitted (Also hidden if parameter image is omitted).
...
Unnamed parameters will be added as fields. Each parameter couple will be treated as field name and field value. See example below for more detailed usage.

[edit] Example

This is an example of an infobox about Spore (video game). See the talk page for more examples.

[edit] Code

{{User:AndreasBlixt/Sandbox/Infobox template
| image      = Spore logo.png
| imagetitle = Spore logo
| float      = none

| [[Video game developer|Developer(s)]]       | [[Maxis]]
| [[Video game publisher|Publisher(s)]]       | [[Electronic Arts|EA Games]]
| [[Game designer|Designer(s)]]               | [[Will Wright]]
| Release date(s)                             | [[Q1]] [[2007]] [[TBC]]
| [[Computer and video game genres|Genre(s)]] | [[Simulation game|Simulation]]
| Mode(s)                                     | [[Massively single-player]]
| Rating(s)                                   | [[ESRB]]: Rating Pending
| Platform(s)                                 | [[Microsoft Windows|Windows]], [[Playstation Portable|PSP]], [[Nintendo DS|DS]], [[mobile phone]]s, [[Xbox 360|360]], [[Wii]] and [[PlayStation 3]] confirmed.
}}

[edit] Output