Help:Using Templates
This page documents a YC Wiki Guideline. It is a generally accepted standard that editors should follow, though it should be treated with common sense and the occasional exception. |
This article is meant to be brief and to the point. If you do not understand its content, chances are you should not be doing it anyways.
Contents
Using Templates
To use a pre-existing template (see Help:List of Templates), simply type {{template name}}
at the desired point in your article and specify parameters if applicable. Parameters can specified either named or unnamed, depending on the template: unnamed parameters look like this: {{template name|param1|param2}}
; named parameters look like this: {{template name|name=value of parameter|name2=value of parameter 2}}
Templates Within Templates
You can use pre-existing templates to help you create your template. An example of this is the inappropriate person template. This template requires 3 simple parameters and will create a notice like the ones on Wikipedia. Although you can specify width, background colour and many other variables, we would like that all templates follow the same format and style such as the one illustrated in the inappropriate person template. Editors and other staff members will routinely convert any non-conforming templates to the preferred format and style.
Creating Templates
Coding
There are many different ways to code a template, depending on how it is structured. Some are done using HTML, some Wikicode, and some use a combination of both; in general, it is better to use Wikicode instead of the equivalent HTML tags where possible (e.g. for tables and for bold/italic formatting). View pre-existing templates and model your code closely after them wherever possible.
Templates can also make use of parameters; of Magic Words, which are built-in variables or functions that act like templates; and of ParserFunctions, which are programming-like constructs like conditional statements, math expressions, etc.
For a detailed, technical description of templates, please see the template documentation on the WikiMedia website.
Current List of Templates
If you are unsure if your template's purpose is already covered by an existing template, you can refer to this list. If you have created a template, please add it to the list.