With templates being so easy to create and implement on a MediaWiki installation, there's really no valid reason not to use them. If you're unfamiliar with MediaWiki templates, please note that a template in this case is not synonymous with a style, skin, or theme. MediaWiki supports those as well, but templates are of special interest because they can make life on a wiki so much easier.
First of all, a template allows you to create wiki markup, as you would when creating or editing any other page on the wiki. Additionally, templates support as many variables as you so choose to give them. This means that you can create the markup for the presentation of some content in a template, and then insert variables where you desire dynamic information to be displayed. Once you have the template created, you can use it on as many pages as you wish and you can always go back and edit it as needed. You can do all of this on the wiki directly – you needn't edit any files of the MediaWiki installation.
Templates are especially great for times when you need a lot of articles (or perhaps sections of articles) to contain important information that you would like to be formatted neatly and consistently. For instance, let's assume we are documenting a bunch of different makes and models of automobiles, each vehicle having its own page on the wiki.
Ordinarily, we might create pages that contain the following table:
Wiki Tables
{| | '''Make''' || Jeep |- | '''Model''' || Grand Cherokee |- | '''Year''' || 2000 |- |}
HTML Tables (Not Recommended)
<table> <tr> <td><strong>Make</strong></td> <td>Jeep</td> </tr> <tr> <td><strong>Model</strong></td> <td>Grand Cherokee</td> </tr> <tr> <td><strong>Year</strong></td> <td>2000</td> </tr> </table>
If we choose one of the above methods, either Wiki Tables or HTML Tables, it's rather simple and Wiki Tables are a bit more clean in the wiki source for an article (outright HTML unless absolutely necessary is not advised, for sake of keeping the wiki friendly for people not versed in HTML markup).
We will end up with something like this:
Make | Jeep |
Model | Grand Cherokee |
Year | 2000 |
However, we may not want to type out all of the text for the Wiki Table or the HTML Table each time we create a page for another vehicle. We may not even wish to copy and paste the table and scroll through and change values. Wouldn't it be nice if we could design the table & format of the content only once, and then from there on, just assign values to the variables Make, Model, and Year? Fortunately, with wiki templates, we can accomplish exactly that!
We're going to create a template called Vehicle, and use it to format information for the Make, Model, and Year of any given vehicle. Then we're going to use it on a page. On MediaWiki, enter Template:Vehicle into the search box and click Go. You will be taken to a page that will say something like "There is no page titled 'Template:Vehicle'. You can create this page.", so go ahead and click on create this page.
Now, enter the following Wiki Table markup onto the template page:
{| | '''Make''' || {{{1}}} |- | '''Model''' || {{{2}}} |- | '''Year''' || {{{3}}} |- |}
You can insert as many variables as you want by enclosing an integer in triple braces: {{{x}}} (x is an integer). The variables will be set in an ascending order starting from 1.
Now we have a reusable template, so let's see just how easy it is to use. Assuming we're going to create an article for a Grand Cherokee, we'll include this template and fill in the proper data by entering the following onto the Grand Cherokee article:
{{vehicle|Jeep|Grand Cherokee|2000}}
This will show up on the page just the same as if we had included all of the table markup. However, including all that markup is redundant and unnecessary in light of templates. The following is our result:
Make | Jeep |
Model | Grand Cherokee |
Year | 2000 |
This is a very simplified example, but it still helps make repetitive content easier to add while maintaining cleanliness. Your templates can be much more complex, and your data and desired formatting may demand that they be. In the future, I will be sure to offer more advanced examples of how templates can be useful in complex situations. I hope this encourages you to make use of templates on your wiki. It will help you maintain your sanity in the long term.