Help:Templates

From sureai
Revision as of 18:14, 9 May 2017 by Davipb (Talk | contribs) (Text adapted from the German wiki)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
< Help

Templates are pages which can be integrated as text modules in articles. Templates are used to achieve a uniform appearance and make the article source text easier by swapping formatting commands. Templates live in the namespace "Template:". New templates can be created by any user. Templates should be placed in the Category:Templates to make them available to all users. Please note the correct classification into the following two types:

Templates without Parameters

These templates take no parameters, which means they can't be customized. They'll appear the same wherever they're inserted, and usually provide common information about the content that follows it. If the information they represent is no longer valid after an edit, you should remove them too. Examples of fixed templates include Template:Stub and Template:Needs Images.

To display a fixed template in an article, the template name (without the prefix "Template:") is inserted into the wikitext of an article within two braces: {{Template Name}}. When the article is displayed, this is then replaced by the entire unchanged content of the template. Subsequent changes to the template directly affect all articles where they are used.

You can also include templates with {{subst:Template Name}}. When saving the article, this is replaced in the source text by the entire current content of the template. Since any trace of the original template substitution is erased upon saving, future changes to the template are not reflected in the page. As such, you should avoid this method.

Templates with Parameters

These templates take some parameters, which means their content can be customized. They usually provide a common look and formatting to various related elements, or simplify the input of complex formatting. Examples of templates with parameters are Template:Quest Header and Template:NPC.

The wikitext code used to insert these templates is the same as for those without parameters, except for the parameter syntax: Parameters are separated by pipes (vertical lines - |), and optionally preceded by the parameter name and an equals sign (Name=Value). Parameters without names are called "anonymous parameters", and they receive automatic names that are simply numbers, going up from 1. For example, to use a template "Example" with the parameter "Name" equals to "Test" and "Age" equals to "25", you'd use: {{Example|Name=Test|Age=25}}.