When editing this page, please ensure your contributions are relevant, useful and easy for other people to understand. If in doubt, discuss on the talk page.
Templates are used on GTA Wiki as easy ways to instantly insert a particular set of instructions. Common usages are the messages at the top of the page (including this page), or Userboxes.
Templates are used by putting their tag at the top of the page, or wherever they are needed. A template's tag is its name in curly braces.
Templates are made simply by creating a page called Template:Name - and whatever is on that page will show up in every instance of the {{Name}} tag on GTA Wiki.
{{help}} shows up the banner at the top of this page. It is defined at Template:help, and automatically assigns any page it is used on to a category, which is Category:Help. Not all templates do this.
Whenever the template is edited, each page that uses that template will change too. If you do not wish to link back to the template page, you can use {{subst templatename}}. Subst simply includes the contents of templatename once.
Any page can be used as a template, by putting a colon (:) at the start of the tag. {{:User:Xenon}} would show the contents of the User:Xenon page. Also, subpages can be linked to directly with a slash (/) at the start of the tag. Grand Theft Auto IV quickly includes Grand Theft Auto IV/infobox with the tag {{/infobox}}.
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, it 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.
Creating content that should appear on many pages.
Formatting content (such as 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.
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, go 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.
Adding and editing pre-existing templates
Wikis come with pre-loaded default templates. You can 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 the Visual editing mode, you can select from the list of all templates available on your wiki by clicking "Add other templates".
In source mode, you can use the code {{Template name}} to add any template to your wiki.
Advanced users can edit the page MediaWiki:Editor-template-list to change the list of templates available by default in the "Templates" section of the editor. Up to 4 templates can be in this list.
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.
Wikia's official Starter Pages and semi-official 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.
Template Webinar
Looking for further video instruction? This webinar recording overviews the basics of adding and customizing templates for your wiki.