User:Bruce A/Template guide

I'm not an expert template creator, but in creating templates for the wikis I contribute to, I've learned some things that I'd like to share that I don't feel are covered in other guides I've seen.

My approach to templates
I want templates I create to:
 * Have visually consistent design
 * Be as unobtrusive as possible
 * Be easy to edit
 * Be modular (meaning, they can be tweaked easily)
 * Look good

The two types of templates
There are basically two types of templates that I know of:
 * 1) Templates that add articles to categories. These are used to help categorise pages on a wiki. Examples include:
 * 2) Templates that don't. E.g.
 * 1) Templates that don't. E.g.

The basis

I use a pre-created template as the basis for most templates I create.

This is what it looks like. Click "Edit" on that page to see the code for it.

The structure of a template
The templates I create consist of: You will usually want most of those things in templates you create, but you can omit some things if you want once you know what each aspect does.
 * 1) Template code
 * 2) Categories the pages with the template will be added to (if any)
 * 3) Code that stops anything below from appearing in the template
 * 4) Explanation of how to use the template
 * 5) Helpful links related to the template (i.e. a "See also" and "External links" section)
 * 6) Categories the template page will be placed in
 * 7) Explanation code, to make the code easier for people to read and understand

Let's go through each of those by looking at an actual "page stub" template, which I like to call "Needs expansion" (as in, "This article needs expansion") rather than "Stub" or "Page stub" since I try to minimise jargon.

Putting it all together
The final result:

&lt;nowiki&gt;

&lt;/nowiki&gt;