From StrategyWiki, the video game walkthrough and strategy guide wiki
Revision as of 05:07, 13 May 2007 by Garrett (talk | contribs) (Help:Template moved to StrategyWiki:Guide/Templates: merging edit histories)
Jump to navigation Jump to search

Templates are pre-created content that you can easily drop into wiki pages.

Using Templates

Inserting a template into a page is easy. Simply surround the template name with two curly brackets on each side, like this:

{{example}}

This will insert the contents of the template named "example". Note that if a template is modified after it has been placed in pages, its appearance will be updated on all of the pages that use it.

Some templates allow you to insert your own content into the template's body. Use the following format if the template you want to use has changeable fields:

{{example|field1=ABC|field2=DEF}}

This places the text "ABC" into the field called "field1" and "DEF" into the field called "field2".

Sometimes you do not need to name the field:

{{example|ABC|DEF}}

You can also break up the fields onto multiple lines for readability:

{{example
|field1=ABC
|field2=DEF
}}

Some useful templates

Finding Templates

Templates exist in the "Template" namespace. You can see all existing templates by viewing the Allpages special page and selecting the Template namespace.

Creating/Editing Templates

To create or edit a template, enter the name of the template into the search box and press Go. Remember that templates are in the "Template" namespace, so you must prefix your template name with "Template:"

Template:example

You can edit a template just like any other page. Make your changes in the edit box and then save them to update the template. This will change the appearance of the template throughout the whole wiki, including on pages which already use the template.

To put in changeable fields, surround the name of the field with three curly brackets:

{{{fieldname}}}

This allows people to fill in that space with their own content when using your template.

You can also create "nameless" fields by using numbers:

{{{1}}}

The numbers will be filled in with content in order.

External Help

http://meta.wikimedia.org/wiki/Help:Template_namespace - Mediawiki documentation http://home.comcast.net/~gerisch/MediaWikiTemplates.html - Brief tutorial