Philosophy
 

Help:Template

Religion-wiki — for all religions and none

WP:WN

Religion Wiki

General Information  ·   Getting started  ·   Editing    Start your own article here    2,370 articles in our database.   


Templates are a handy way of introducing standard content to pages on Religion-wiki. These can be tables, navigation bars, headers, footers...anything you desire to place on a number of pages.

First of all, create the master copy of your template in the template namespace: just create a page called Template:Name, replacing Name with whatever you would like your template to be called.

Once you are happy with the look of your template, you can begin to insert it into pages. This is done by typing {{Name}} at the place on the page where you would like to insert your template.

Contents

Parameters

You can customise a template on each page on which it is used by using parameters.

To set up a parameter, you enclose the parameter's name in triple braces in the text of the template. For example, you could write a template like this:

:''Please see [[{{{parameter}}}]].''

Then (if the template is called 'Name'), it can be called and given its parameter like this:

{{Name|parameter=Help:Contents}}

This would then produce on the page:

Please see Help:Contents.

Multiple parameters

You can use more than one parameter in a template. Of course, each parameter needs to have its own name. When you call the template, each parameter should be separated by a pipe (|).

{{Name|parameterone=rhubarb|parametertwo=bunk|parameterthree=blog}}

The parameters do not need to be given in any order.

Simple numbered parameters

Parameters can be numbered instead of named: {{{1}}}, {{{2}}}, {{{3}}} and so forth.

In this case, you do not have to write 1=rhubarb as long as you define the parameters in numerical order.

{{Name|rhubarb|bunk|blog}}

Missing parameters

If a template has been set up with a parameter, all pages which call it have to define that parameter. If the parameter is left undefined, it may well show through on the page.

Therefore, if Template:Name had {{{parameter}}}, then all pages that call it have to, at least, have {{Name|parameter= }}. This would leave a blank where the text of the parameter is supposed to go. If the page simply had {{Name}}, then the text {{{parameter}}} will show through onto the page.

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.

Contents

Referencing templates

Transcluded template

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

Substituted template

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.