From SmashWiki, the Super Smash Bros. wiki
A template is a page, like its title says, a page which can be included into any other page, and sometimes be customized. This page gives tips on creating and using templates.
[edit] Creating templates
Templates in most cases, are very easy to create. They should have the prefix Template: (see Help:Namespaces), but it doesn't need to be included to other pages.
This template below is an example. It can be included in the current page by typing {{example}}. "Example" is the name of the template, and the two curly braces are used to include it:
Correct
The template was successfully included in this page.
Sometimes, you may want to write about the template on its page (often to explain how and when to use it), but you don't want this text to appear on the template itself. To do this, you should enclose such text with <noinclude> and </noinclude> so that it does not appear on every page you use the template on. An example can be found in the {{policy}} template. Below the box is a line of text that does not appear on policy pages. The opposite can also be made, by writing <noinclude> and </noinclude> tags around to only make text appear when included. This is very useful for categories.
[edit] Modifyers
[edit] Non-template namespace
By writing {{Namespace:Page name}}, pages from various namespaces can be included. To include namespaceless pages, {{:Page name}} should be written.
[edit] Substitution
Templates can be substituted by writing {{SUBST:Template name}}, {{SUBST:Namespace:Page name}} or {{SUBST::Page name}}. By writing {{SUBST:Example}}, the content on {{Example}} is placed on the page instead of just {{Example}} when someone edits.
A template is a special type of page that has been designed so its content can be included in one or more other pages. Since a given template can be included in many pages, templates can help reduce duplication and promote a uniform style between pages.
Templates are usually located in the Template namespace, which means any page name beginning with Template:, such as Template:Name. However, any page can act as a template.
Referencing templates
The content of a template can be added to a page by referencing it using the wiki markup: {{templatename}}. This references the template and includes its output at the point of insertion. Articles will be updated automatically when referenced templates are changed. A page that references templates cannot be edited to change the content of a referenced template, although a list of referenced templates will be displayed at the bottom of the page for convenience while editing it.
Substituting templates
A different way to use a template is to substitute its content into a page. This is done by inserting subst: immediately after the opening braces: {{subst:templatename}}. Once the page is saved, the link to the template is removed and the template output is substituted in its place and can be further edited. Any updates to the template will not affect the content that was substituted into the page.
Benefits of templates
Templates are used to add recurring messages to pages in a consistent way, to add boilerplate messages, to create infoboxes and navigational boxes, and to provide cross-language portability of texts.
Templates can also make it much easier for new and casual editors to use advanced designs, features and extensions by hiding confusing code.
Creating a template
In short, create the text you want to have copied onto the target pages on a page in the Template namespace. Creating Template:Templatename will allow users to insert {{templatename}} into a page to display your text.
See Help:Creating templates for details.
For an overview, see the quick guide to templates on Wikimedia's Meta-Wiki.
Creating an advanced template
To learn how to change the output of the template based on what the user inputs, see Help:Template parameters and Help:Parser functions.
Updating and adding standard templates
Wikia's Starter Pages and Templates wikis occasionally improve some of their documentation as well as adding new templates specifically designed for Wikia sites, and are therefore worth checking from time to time. For sites created before about December 2008, the Starter Pages wiki should be compared and ideally used for upgrading to its standard documentation system similar to that introduced in Wikipedia.