User:Emma/Templates

If you have any questions for me about this information or anything else about templates ask on my talk page.

Template Guidelines
This is the rules I live by for template editing and creation. As of right now they're just my own rules and NOT official policy.

Readability
The template's coding has to be properly formatted in the edit view to make it easily readable. This makes editing and debugging much easier. Line breaks that do not parse into the final template but clear up the edit view can be made with hidden comment coding: '  as anything in them, even line breaks, are not visible or even added to the page when not in edit view.

Practicality
Do not attempt to have your template do too much by itself. This leads to clunky templates which are very difficult to debug and update. Instead break down various functions you wish to do into separate templates. Very often you will find that these separate functions will be useful in another template. And often you may find that a function you want has already been made for use.

Documentation
All templates are to have proper Purpose and Usage sections, and if desired an Example section. The Usage section should either use the NoWikiTemp template or  tags to illustrate the template's parameters. The parameters should ALWAYS be described using the Parameter template.

Categorizing
The template must be properly categorized. For ease and consistency templates should be categorized using the Cat template.

Usage Changes
If a template is updated to improve its usage in a way that makes all current instances of its use invalid, it is the responsibility of the editor that made the change to update each instance of the template, or to enlist help to do so.

Naming Standards
Templates are not articles. They're intended to be used as tools. So their names should be simple and if necessary abbreviations, but not too simple as to the point of being confusing. Templates are not subject to typical article standards for naming as far as capitalization is concerned. Though excess profanity is still out of the question. But it is good to maintain a format. One way is to have the name as one word, with each word that makes it up denoted by capitalizing the first letter, such as ImageLink. This saves space and is easy to read.

Variables
For variables on templates, they most often should be defined at the top of the template. If necessary for multiple variables, use a hidden comment line break to separate them without adding an actual line break to the template. Variables with the same name as another one are a special case. If two templates have the same named variable but have different values for it, here's how the wiki treats its value on a page: Test = A Test = A Test = A Test = A Test = A Test = A Test = B Test = B Test = B The variable can be used anytime after it is defined even in other templates. But once a template defines the same variable itself, the value changes to that. So templates should never conflict with each other so long as the variables are properly defined.