Community Central
Community Central

A template is a special type of page that has been designed so its content can be included in 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. This includes any page with a name beginning with Template:, such as Template:Name.

Video Overview

If you're new to templates, this video will help you get started... 600px

Why use templates?

Templates can be useful for...

  • Creating content that should appear on many pages.
  • Formatting content (like infoboxes) in a way that should be consistent across many pages.
  • Creating a shortcut for writing things that you repeat often when communicating with others.
  • Replacing long, complicated code so that a page is easier for other users to edit.
  • Protecting parts of a page from editing while leaving other sections open for edits.

How to Create a Basic Template

Templates can be very powerful, but also sometimes very complicated. It often helps to start by creating the simplest possible kind of template, and then experimenting from there.

  • Type "Hello World" in the editor.
  • Click "Publish." You have just created a template with some sample content.
  • On your wiki, create a new article called "Testing Templates".
  • In the editor, to Source mode and enter the following code:
{{Example}}
  • Click Publish. Your "Testing Templates" page should display the text you added to your template.

You've successfully created and used a template! Now you can change the content of your template and add it to more pages to make it more useful for your wiki.

How to Add and Edit Pre-Existing Templates

Templates-rightrail

Wikis come with pre-loaded with a many default templates. Here's how to use them.

  • View a complete list of templates available on your wiki by going to Special:AllPages and selecting "Template" from the namespace dropdown menu. Click "Go" and all available templates will appear in a list.
  • In another tab, open an article page for editing in Visual Mode.
  • In the "Templates" section of the right rail, click "Add other templates".
  • Search for the name of the template you would like to use (referencing the list you found above).
  • If any content is needed for the template, enter it in the Parameters section. Preview the template to make sure it looks right.
  • Click "Okay". The template appears on the page as a green puzzle piece, to mark its placement.
  • Mouse over the puzzle piece to view the template. This will also give you options to edit and delete it.
  • Publish the page when you're ready.

Substituting templates

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.

Creating an advanced template

View this instructional video for more guidance.


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.

See also

Further Help & Feedback