Help:Using infoboxes

Among the most complex templates on the wiki are those regarding infoboxes. By now, the editor should be at least somewhat familiar with what an infobox is by seeing examples on existing articles. The following will instruct the editor how to use and modify infoboxes in articles.

Basics

Infoboxes are essential for most types of content on the wiki, and are always placed at or near the top of an article before the opening abstract. The purpose of an infobox is to provide concise information about the subject in question, and quickly link to related material on the wiki using an easy-to-read format. That said, the template itself is not simple in the slightest, and requires a lot of code to function. This article will not attempt to explain how to build an infobox from scratch, but it will provide some pointers for creating duplicate templates for use in other contexts.

Before going further, it may be handy to include a list of infobox templates which can be referenced. (For now, do not worry about the Infobox parts subcategory.)

Inserting an infobox

The first thing to decide is which infobox is most appropriate to use on a given page. Common subjects include games, characters, enemies, items, or places. Each of these has a distinct infobox which should be used. Though each of these infoboxes cover different subjects and have different parameters, they all use the same basic infrastructure, and as such, are used in a similar way.

To find out what parameters a given infobox takes, the editor may go to the template page for that infobox and find a list of parameters in the template documentation. To do this without having to type in the template page name or look it up, the editor can find a handy set of links on the infobox itself down at the bottom, listed as "This box: view • talk • edit". Clicking the links will take the editor to the main template page, the talk page for that template, or to the editing window for the template page respectively.

Once this knowledge is gathered, the editor may define the infobox on the page by using the following container:

{{Infobox-Name
|title=
|image (or track)= 
|caption= 
|param1=
|param2=
|param3=
|etc.=
}}

where "Name" is replaced with the name of the infobox in question, and the parameters following "|caption" are replaced with specific parameters which can be filled in.

More on parameters

One of the neat aspects of infoboxes is that the parameters are very flexible for the most part. Most can be defined out of order, left blank, or simply not included without causing any problems for display. In order to clarify their use, the following list will contain every common infobox parameter which may be found, along with some of the less common ones. It should be noted that these parameters do not apply to all infoboxes, so care should be taken to ensure the right ones are being used:

  • title - This optional parameter allows the editor to change the title of the infobox, which defaults to the name of the article. This is useful for removing qualifiers from infobox titles or being more specific in an article section.
  • image - This parameter is a space where images can be inserted. If nothing is added here, a placeholder image will be used instead prompting the editor to find an image for the infobox. For the Music infobox, the track parameter should be used instead.
  • caption - This parameter is used to add a text caption underneath an image or track inserted into the infobox. Ideally, this should not be left blank, and should contain the name of the subject in question in bold, and stipulate where the particular image or track is from.
  • game1 - This parameter should list the first Kirby game which the subject appeared in.
  • lastgame - This parameter should list the most recent game which the subject appeared in. It should be left blank if the subject only appeared in one game.
  • game - This parameter is used to list every other game the subject appeared in aside from the first and most recent in chronological order. This list should use small text and have line breaks between each game entry. For some infoboxes, this will be the only game parameter, so it should list all games the subject appeared in.
  • similar OR compare - This optional parameter is used to list off subjects that are similar in character to the one being described. This list is somewhat arbitrary, but the choices should be justifiable.
  • related - This optional parameter is used to list entities that are directly related to the subject in some way.
  • theme music - This parameter is used to contain an audio clip for infoboxes which contain a theme music section.
  • theme title - This parameter should be used after theme music to list the main article for the clip in question.
  • description - This parameter should be used after theme music to describe the music clip in question.
  • previous OR variations thereof - This parameter is used to link to another subject which is sequentially linked to the main subject and directly precedes it. It should be left blank if no previous subject is applicable.
  • next OR variations thereof - This parameter is used to link to another subject which is sequentially linked to the main subject and directly follows it. It should be left blank if no next subject is applicable.

There are many other more specific terms which apply to certain infoboxes. Information about those terms can be found on the appropriate infobox template pages or by observing the infoboxes in action in a page.

Creating a new infobox

Main article: Help:Creating templates

In some cases, it is necessary to create a new infobox for a particular subject matter. This usually only comes up when a new major game is released which contains a new category of things. As mentioned above, this article will not attempt to describe how to build such a template from scratch, as that is usually not necessary. Instead, it is often easier to simply copy and paste an existing infobox template and adjust the parameters as needed. The following are things to keep in mind when defining a new infobox in this way.

Colors

It is highly recommended to change the color scheme of the infobox to a unique combination, preferably one that matches the motif of the subject in question. To do this, the editor will need to find the following pieces of code in each infobox part as follows (example code taken from Template:Infobox-KSAWorld):

| border = 2px solid #4499FF;
| style1 = background:#FF8877;
| style2 = background:#F9DDDA;
| style3 = background:#FFFAF0;

These define the colors and border thickness of the infobox piece. Usually, the border thickness does not need to be adjusted, so the only thing to adjust are the hexadecimal color values at the end of each statement. Editors unfamiliar with hexadecimal color formatting should visit this Wikipedia page for details. Choosing appropriate colors is a judgment call on part of the editor, but they should not impede readability and should be consistent across the whole infobox.

Parameters

Often, certain parameters will need to be added, removed, or changed when defining a new infobox. The following is an example of some parameters in an infobox (example code again taken from Template:Infobox-KSAWorld):

| Info1name = Normal Stages
| Info1details ={{{stage|}}}
| Info2name = Extra Stages
| Info2details ={{{exstage|}}}
| Info3name = Boss(es)
| Info3details ={{{boss|}}}

There are three parameters defined here, though more parameters appear as part of the infobox part's internal coding. Up to eight parameters can be defined within the Begin template piece. Each parameter comes in two pieces, as seen above. The first piece gives the parameter name as it appears on the infobox to the reader, and the second piece defines the parameter as called by the editor when inserting the infobox into the page. These parameters are designed to take in text input, so inserting anything else is possible, but may cause things to look off.

Pieces

All infoboxes must have a Begin and End piece within them to function. Other pieces may be added or removed as needed for further functionality. For more info on this subject, see this category.

In the End piece, there is a parameter called "name" which must be filled with the name of the infobox without the "Template:" prefix. Failing to do this step will result in some aspects of the infobox not working correctly.

Make sure that all new infoboxes are correctly categorized and have proper documentation.