Help:Templates
From BayTeam
| Help |
|---|
| Wiki |
| Navigation |
| Editing |
|
Adding article |
| Policies and guidelines |
| Agility |
This wiki software allows us to define templates, which in other languages might be called macros (or other similar terms).
Contents |
[edit] Overview
A template can define standard text that you'd like to appear in more than one place. For example, you could define a template named needswork that, when inserted into a page, displays text like this:
This page needs more work to make it look good.
Furthermore, templates can have arguments (parameters) that allow you to specify repetitive data in a standard and more easily understandable way. For example, you could define a template named trial-committee that provides space for someone to type the names of trial committee members and then displays the list in a nice format as defined within the template, rather than making the editor do all the work over and over.
[edit] Template usage
When editing an article, you see templates like this:
{{needswork}}
or like this:
{{trial-committee|chair=Fred Smith|secretary1=Jane Doe|secretary2=Tien Tranh}}
[edit] Template definition
To create a template, you simply create an article titled "Template:nameofyourtemplate"; for example, Template:needswork or Template:trial-committee. Whatever you put into that article then appears whenever you insert the template (as shown in "Template usage") into another article.
[edit] Complexities
Of course, it's almost never that simple. Here are some example templates, whose content you can examine by clicking their edit tabs:
- Template:Addtocategory, which displays standard text and also uses a predefined variable to display the name of the current article.
- Template:Disambig, which displays standard text and also puts any article in which it appears into a specific category.
- Template:Trial, which allows parameters, then displays the values into a formatted table AND this template displays usage information about the template itself.
[edit] See also
- Special:Prefixindex where you can select the Template namespace and see the names of all templates that currently exist.
- BTwiki templates, which lists existing templates and shows what they produce
[edit] External links
- Wikipedia "Help:Template" page (I find this to be a little arcane for new users, even though it's supposed to be the intro page to templates.)
- (Ellen: need more links to detailed help on wikipedia, wikimedia, etc.)
