Help:Templates

Templates are used to organize categories in the Encyclopedia. In most cases, using a template is as simple as inserting its' code: Usage documentation can usually be found on the template page itself, in a section below the actual template; for example, to see Usage documentation for Template:Halo, go to Template:Halo.

Basic usage documentation template
To keep template pages uniform, there is a basic template to add that describes usage of your template. Copy and the paste the following at the very bottom of your template. ==Usage==

Copy and paste the following:

&lt;pre&gt;

&lt;/pre&gt;

Required parameters
There are no required parameters for this template.

Optional parameters
There are no optional parameters for this template.

Information on the Templateinfo template can be found at Templateinfo usage. Other than that, the setup is fairly self-explanatory.

A required parameter is anything that the template requires beyond just the template call itself; for example, Templateinfo above requires the parameters name, usedfor, and so on. If your template can be called by just using its' name, e.g.   then it has no required parameters.

An optional parameter is, as the name suggests, not required for the template to be called successfully. For an example of a template with both required and optional parameters, see GameInfobox.

If your template uses any sort of DPL-powered automation (see the section on DPL below), please make sure you note this in the Templateinfo call, and include the appropriate   or    template call to let others know whether pages should be added manually or not. (See the partautonote and fullautonote templates for more information.) The call should be placed immediately below the end of the Templateinfo call.

DPL
DPL (Dynamic Page Listing; an extension to MediaWiki) is a way of automatically listing out pages within a certain category. In the context of templates, it can be used to automate the updating of templates when new pages are added.

For example, in the Halo template, it is used for the Factions, Characters, Equipment, Levels, and Books sections. Instead of manually editing the template when a new page is added for one of those sections, as long as the template code, along with the proper optional attribute, is used in the article page, the page will automatically show up in the template.

The basic code for using DPL in a template can be seen below:  category=Halo factions skipthispage=no mode=inline inlinetext=&amp;nbsp;|&amp;nbsp; replaceintitle=/ \(Halo\)/ 

Details on the code:
 *  This tag is used to start the DPL call.
 * category=Halo factions This attribute defines what category or categories are to be included in the list (in this case, Category:Halo factions). Separate multiple categories with a | (pipe) character. (On most keyboards it is shift+\ (backslash) to produce a pipe.)
 * skipthispage=no This attribute causes the current page to be included in the template display. In other words, if you are looking at the Cortana article, and this tag was not present, Cortana would NOT appear in the list of characters in the Halo template box on that page.
 * mode=inline This attribute causes the output of DPL to be inserted right where the DPL call is placed.
 * inlinetext=&amp;nbsp;|&amp;nbsp; This attribute causes the list of articles to be separated with a space, then a pipe character, then another space. This can be changed to, for example, a dash (-), or other characters if desired.
 * replaceintitle=/ \(Halo\)/ Text within a page title can be replaced automatically, using regular expression syntax. In this case, several pages for the Halo section include  (Halo) for disambiguation, but displaying it for each and every page title in a list of titles about Halo is redundant. This code replaces all instances of  (Halo) with nothing.
 *  This tag ends the DPL call.

Much more information on DPL and various output options can be found in the DPL manual.

Character box
This section was left to preserve links, but the information within it was moved to help consolidate documentation into one place. Please refer to Characterbox template usage for information.

Info box
This section was left to preserve links, but the information within it was moved to help consolidate documentation into one place. Please refer to Infobox template usage for information.

Movie box
This section was left to preserve links, but the information within it was moved to help consolidate documentation into one place. Please refer to Movie Infobox template usage for information.

Websites
This section was left to preserve links, but the information within it was moved to help consolidate documentation into one place. Please refer to Website Infobox template usage for information.