Help:Templates

On this page you will get to know how to use templates and get some tips for writing a template.

For a list of the most useful templates see: Men of War - Wiki:Useful TemplatesFor a project page to create a template see: Men of War - Wiki:Create a TemplateFor a special page about templates see: Special:CreateTemplateFor a list of all templates in alphabetical order see: Special:Templates

What are "templates"?
Templates are articles/article parts which you can use as a help in page writing. Instead of writing once, twice, ... the same (maybe with a few different words), it would sometimes be easier to write it once and use it everytime. That could save work and time, and of course an article looks better in the edit-mode if there is not too much difficult code in it.

In all MediaWiki-sites, there is the feature of using templates, also known from Wikipedia. Using them makes the work with more or less complex wiki-scripts very easy, also for unknowing users, because you only have to read the template-documentation and you allmost know how to use this template.

Writing a template might be a little bit more difficult, but it does not have to (that depends on the template you want to write). Editing a template also is possible. For watching a list of all avaible templates follow this link to: Special:Templates or at: Men of War - Wiki:Create a Template

How to use a template?
Using a template is not often difficult. Most ones are complete ones which only need to be inserted to the text. Other ones need some additional information like text or an image.

Using of template which need extra informations like image-links, internal/external page-links, ... you have to define the information in the folowing step. Make sure you read the template-documentaion before.

The same procedure goes with the similar templates:,  ,   and

This is one of the most difficult templates and must be used in every vehicle page. One of the best examples of this template in use is the article Opel Blitz. Here is also used a template called " " which shows an uploaded picture of the unit/vehicle. Please use this template also if you want to write an article about one of these, because they give it a very good look and sortation. Also use them, if you do not have already uploaded an image, use only a link to it. If you do not know every unit fact which is necessary, only use a "?". Then, another user who maybe knows it can edit the article and change it. Not very recommented are arcticles which do not use these templates, so try to take them into our ones.

Writing a template
Templates, you normally write like articles. The only differences will be explained to you under this headline.

There are 2 possibillities to create a template:
 * with the special page "CreateTemplate"
 * by creating an article with Template as namespace

For the first option, there is not much to explain. The second one is the difficult one: Here you have to create a normal article page. But instead of the standart namespace (using no prefix) you have to give the prefix "Template" to the page by adding this text before the page name:. It sais the wiki program to set the value "template" for the article. Now, you only have to type the name of the template. At the page you use the normal wiki-script (everything is here allowed, too).

For a higher template you also have to prepage variables. In this case, you use them instead of words or numbers. For example they can be used to define the height of a table, but also of some text. You enter the variable into the template at that position where the definition would stand. The name of the variable does not metter, but it should have something to do with the content of it. In the template, the variables become written in the same style as in the article they are used later ( ...  ).

This formula tries to describe the using of template variables with an easy example:$$Count= + =3,7 = Count=3,7$$

In fact it means:$$Prepared variable + Variable definition = Final count$$

Writing a template ducumentation
For writing the template documentation which is recommented to everyone, you need some additional wiki-codes which you do not need anywhere else: the template-seperation scripts. The template-seperation scripts (TSS) are used to seperate the template from the documentation. This is needed when you are writing the template ducumentation.

There are 2 ways to seperate them:
 * seperate the template with onlyinclude
 * seperate the documentation with noinclude

It is on your own to decide which one you want to use, but normally noinclude is used in most templates. But onlyinclude is allowed, too.

To seperate the template text from the documentation text you have to fill the template text into the wiki-code between  and. If you want to seperate the template documentation from the template text, you have to fill in the code between  and.