Tutorial/Templates
This article is a work in progress. ...Well, all the articles here are, in a way. But this one moreso, and the article may contain incomplete information and editor's notes. |
Templates are a special type of wiki page which can be easily used on other pages. These are typically placed in the template namespace[note 1], but a template can be placed in the main namespace and still work the same[note 2].
Using templates
To use a template, simply put the name of the template between double curly brackets. For example, so use the "Citation needed" template you'd use {{Citation needed}}. This particular template works without any parameters, so that's all you need to place it on a page. It looks like this when rendered:
[citation needed]
Some templates like Template:Distinguish require parameters which can be set by using a pipe (|) to separate the template name from the parameters. Distinguish only needs one parameter at minimum, so the following works: {{Distinguish|any link here}}. When rendered, it looks like this:
Creating templates
Notes
- ↑ A namespace is basically a prefix that determines the type of page. The main namespace has no prefix and is where articles are placed. The template namespace contains any page with a
Template:at the start of its name. For example, the pageTemplate:Citation neededis called "Citation needed" and the "Template:" at the start marks that it's in the template namespace. - ↑ There are some namespaces with special properties like
Module:, but we won't be going into those here.