Help:Using Templates

From The DarkMod Wiki
Jump to navigationJump to search

What is an template?

A template is any wiki article where the name starts with Template:, e.g. the article is inside the namespace Template.

And why is that so special?

The special things about templates is that any of these can be included into another article. To make things even more versatile, each template can take one or more parameters - and these parameters influence the text that is included, so that the same template can look different when included into two different articles.

How do I use Templates

Templates are included in other articles by using the special template-inclusion syntax:

{{template-name-here}}

So you just wrap the article name without the Template:-prefix into double curly braces and the content of the template will be included at this place.

Parameters

Templates can have named parameters, and each parameter has a (typical) default value. Parameters are specified in the form of name=value, and the parameters will be separated by | (the pipe character):

 {{template-name-here|parameter_1=value_1|parameter_2=value_2}}

The order of the parameters does not matter, but they have to come after the template name.

Finding usable templates

The Templates category lists all available templates.

Creating a template

To create a template, simple use the New Article menu entry on the left, then choose a good name and prefix it with Template:. Please also include help in the template and sort the template into the category "Templates". If you are unsure how to do this, use this template as an example: Template:Editing