Help:Infoboxes


 * For information on infoboxes in general, see Help:Infoboxes. This article specifically describes the new changes to enable correct display for mobile users.

Portable Infoboxes refer to Wikia's new infobox markup which is in early beta. The rationale is to help them display well across mobiles and other portable devices, hence the name. As this page assumes you are familiar with infoboxes in general, you will know that they are generally made using templates, to create consistency across a community. This is not changing. However, the way that infoboxes are created is, and this markup is detailed below. For more information on this new type of infobox code, see this forum thread by Ducksoup of the Wikia staff.

A tool to aid infobox migration to the new coding style is currently being tested - more information about this tool can be found here: Help:InfoboxMigration.

If you are new to the concept, Infoboxes are fact sheets, or sidebars in magazine articles, designed to present a summary of the topic of the page and present important points in an organized and quickly readable format. More information is provided at Help:Infobox, which is the link in the hatnote at the top of the page.

How to use an infobox
You can add an infobox to an article the same way as you would any other template - either via the editor's built-in template tools, or through the editor's source mode. In the latter case, you would generally start by copying the syntax from the template's documentation (normally found towards the bottom of the template's page) and pasting it into an article, changing the words after the equals signs to provide the desired information. For example:

This is not changing with the new coding and templates will still be filled out the same way with the same functionality.

Creating new infoboxes


First, start new template with any name you like - Template:ExampleInfobox, for example. While in the past we used with tables and div tags, we can now use infobox tags. We'll begin with a basic 'stacked' infobox, with a title and an image:

This wikitext will tell your template to use name and image variables for title and image elements. Additionally you can provide the default tag, whose value will be used when a user does not specify a name/image/etc. on the article.

Now we just need two more fields containing additional information, so let's add one:

After adding one last field with source set to first and label to First seen, we end up with the following:

We can now use the template in an article. We must put the following parameters in to get a working infobox:

Styling and display
Infoboxes using this kind of code are automatically styled, taking cues from your community's custom theme. If any of the variables are empty, the relevant row of the template will not be displayed (unless the 'default' tag has been used).

Layout options
Two alternative layout options are available for infoboxes:

...
 * default (tabular) layout - &lt;data> tag labels displayed on the left side of the value

...
 * stacked layout - &lt;data> tag labels displayed above the value

Custom theming
Default infobox theming can be overwritten using either theme or theme-source attributes of the infobox tag, allowing infoboxes to be styled via local community CSS. See to learn more about styling. If both attributes are used inside the infobox tag, the theme attribute is treated as the default. Note that spaces in the values of theme and theme-source are converted to hyphen-minuses, so only a single class may be added using them.
 * The theme attribute is used to specify a custom CSS class for the infobox.
 * The theme-source attribute allows you to vary the CSS class via a template parameter.

For lots more information about how to theme an infobox, including detailed guides, check out Help:PortableInfoboxes/CSS!

Using videos
To add a video into an infobox, simply use the &lt;image> tag - just as you would with an image. When a video is inserted instead of an image, a thumbnail with a play icon and duration info will be shown in the infobox, and clicking on the video will pop up a video player. If you want to add multiple videos, add a new &lt;image> tag per each video.

Advanced usage
Now, that you have created a simple infobox, you can learn how to use more advanced fields. In this section we are going to build the infobox shown on the right.

Multiple ordering options for simple tags
There are three data fields, then title and image fields. As you can see, the title field does not have to be the first field, though you can only use it once per infobox.

Grouping information inside the group tags
The next field will let you put a number of fields into group, each of which can be given a header. Remember: fields that are declared but don't have a value won't appear. This rule also applies to groups - if none of the fields (excluding the header tag) inside any particular group have a value, the whole group won't show up.

Details



Alternative layout for group tags
Group tags can have an alternative horizontal layout where all the content is displayed next to each other in single horizontal line. This can be achieved by adding layout="horizontal" attribute to the group tag.

...

Force all group elements to be displayed
Using show="incomplete", you can force all group elements to be displayed, even when empty - unless all are empty, then the group is not rendered at all.

 Combatants Details  Combatants

Now we can use it in an article, and the work is done:

Field formatting
If you want to prepend or append some additional information to your data - like adding some icons, categories - or to process the passed values, the field formatting allows you to do that.


 * When the tag format is specified for node, the variable provided in source= is then formatted/modified as specified inside the format tag.
 * If the variable provided in source= is empty, the node renders values provided in default tags (or doesn't render if default tags are not specified).

A few sample use cases:
 * Extra text -
 * Links -
 * Categories -

Here, we add an icon through a  template:

The effect shown to the right can be achieved with the following syntax: Price to buy

Available tags
For a detailed list of the standard tags available for portable infoboxes, including samples of wikitext to use and their HTML output, please see Help:PortableInfoboxes/Tags!

Examples

 * Kratos ( source )
 * Beatrix Kiddo ( source )
 * Battle of Arrakeen ( source )

Further help and feedback
es:Ayuda:Infoboxes Portátiles fr:Aide:Infoboxes portables it:Aiuto:Infobox portatili pl:Pomoc:Przenośne infoboksy zh:Help:移動化訊息框 pt:Ajuda:Infoboxes_Portáteis ja:ヘルプ:ポータブル・インフォボックス