From The Urban Dead Wiki
Revision as of 06:39, 5 May 2011 by The General (talk | contribs) (→‎Handy Resources: Categorising)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Templates are "pages" that are intended to be included inside other wiki articles. They tend to be much shorter than normal pages, although they do not need to be.
Note that the double braces - {{ }} can be used to include ANY page in a wiki article, but the Template name space is intended for pages that are only used in this fashion. As such, the "template" portion can be left out when putting the template page name inside braces.
There are also many useful design features that are intended ONLY for use on template pages, as they only have an effect when the template page is included in an article, and are not to be used at all on normal article pages.

Creating templates

You may create a template in the same way you create a normal page, but you must use the namespace template: before the template name. Example: Template:Custom Title

Includeonly and Noinclude

That page was edited just like any other wiki article, but, as you can see, there are two interesting tags within it. The first is the <includeonly> tag. The <includeonly> tags are used to add text and code to a template that will only be used when the template itself is called. This is usally used to categorise pages the template is placed on, without giving the category to the template itself.

The second tag is the <noinclude> tag. The <noinclude> tags are used to add text and code to a template that won't be used when the template itself is called. This is mostly used to add categories to the template itself, and usage comments when parameters are needed. For more help with categories, look at Help:Categories.

Template Usage

You can make a simple template call by using {{TemplateName}}.



will show as

Llama.JPG Drama Llama
The Llama is watching you.

Variable in Templates

Variables in templates are areas of the template that can be changed by whoever uses it. Template:DrunkLevel uses variables.

To create a variable, surround it in three sets of curled brackets, like so:


We'll use the template above as an example.

{| style="border:solid #556655 2px;" width=250 align="center"
| rowspan=2 | [[Image:Martini.jpg|40px]] || style="background:#556655; color:#ffffff;" width=200 align="center" | '''Sobriety'''
| align="center"  style="font-size: xx-small" | {{{User}}} is currently {{{Level}}}

Notice the variables {{{User}}} and {{{Level}}}. These can be set when the template is used. In this case, the user of the template would put it on their page as follows. Notice the pipes to separate the variables:

{{DrunkLevel|User=I|Level=so drunk, I can't use grammer}}

The above will produce this:

Martini.jpg Sobriety
I is currently so drunk, I can't use grammer

Handy Resources

When creating templates, keep the following resources in mind

Editing Help
Basic Editing

Advanced Editing

Advanced Timesavers

Page Tricks

Communicating your Edits


Policies and Guidelines

Policy Documents