What is a template?
Templates are tools
available to you when creating wikis. They allow you to take a shortcut by typing one thing and having it replaced by something else. For example, if you wanted to use that green divider image at the top of the page, but didn't want to type <img:http://www.elftown.com/stuff/2237_wiki_help_9y7vcgcflr5.jpg> over and over again, you could use templates to let you type GREENDIVIDER and the wiki will automatically make the replacement for you. Templates don't always have to work with images, though. They can replace text with symbols, text with text, images with other images, etc. As long as in the wiki code you have some string of letters/numbers that you need replaced by other letters or numbers (which could include <img:> tags or wiki tags, etc), templates can create shortcuts for you.
Okay well why do I need them?
You don't, really. Templates are just shortcuts for you, but some processes can become very simplified by using them. The best way to employ a template is probably to shortcut images, since the code for them gets pretty messy if you use a lot of them. Chesstemplate is probably the clearest use of templates I've seen. Since the owner wanted to create a visual chessboard, she created images for each piece on each color, so people could just replace the image urls to move pieces. You can imagine, though, that the code for that would be pretty hard to read. Thanks to templates, instead of 64 image tags, the codes were shrunk down to 2-3 letters, which made it very much easier to read. Other uses could be as filters. If you don't like profanity on your wiki, you could use a template to replace all curse words with symbols and censor your page. If you make the same typos a lot, you could use a template to replace 'yuo' with 'you' and 'alot' with 'a lot'. Or, you could come up with your own uses for templates. Use your imagination!
Okay, neat! How do I use a template?
There are two parts to a template. First, you need a wiki that provides the template. This page tells any page that uses it what words to replace with what. On this wiki, all you need is to write a list of replacements. Each word to be replaced should be on its own line, followed by a colon (:), followed by the word to be replaced. For example, this template will replace a few of your typos with corrected versions:
It's important to note that capitalization matters for these. 'Yuo' will not be replaced with anything. It is also important to remember that this string of letters anywhere will be replaced. If you make a template that makes the replacement 'and:also', then the word 'thousand' will suddenly become 'thousalso.' As a precaution against this, you might want to include spaces both before and after the words, to ensure that you are only replacing whole words. For example, this might be a better template, because you catch capitalization errors and this also skips words that don't appear by themselves (such as in parts of other words):
yuo : you
Yuo : You
cna : can
Cna : Can
wnat : want
Wnat : Want
(It is hard to see on the text version of this page, but each of these words has a space before and after it.)
Also, it's okay to have explanations or comments before or after the replacement section of the template wiki. If the line does not have a colon, it will not be a part of the template, but the rest of the template will work correctly. The last thing I want to mention is that, again, you can easily use the wiki's pseudo-html in your template too. For example, the following two template lines would work perfectly:
You'll note that these are all capitalized. This is a precaution so that people talking about their templatepage don't accidentally trigger the template.
The final step is to apply the template to a wiki. Any wiki you can edit can use any other wiki for a template. Once you've designed your template wiki, go to the wiki you want to use it on, and put at the top of that page "Template:nameofwiki". So, if we use the chesstemplate example, the first line of your wiki would look like this:
This line won't actually appear on the wiki, just in the edit box. Once you've done this, the wiki will now look at the template wiki. Any lines that have a colon in them will be used for replacement. Text before the colon in that line will be replaced by the text after the colon in that line. Keep in mind that if you use the 'preview' feature when editing your wiki, the template won't be visible. You will be seeing your page pre-template, but once you actually submit the changes, the template will kick in for anyone viewing the page.
Go or return to:
-The help index
|Show these comments on your site|