Bludwyng's Guide to Using Templates
| WORK IN PROGRESS |
|---|
| The editor working on this page, Bludwyng, asks that no one edit this page until this notice is removed or 3 days have passed with no edits. This notice was added to this page on June 16. |
| Contents [hide] |
Purpose of this Guide
I am going to explain to you, the eager, new, Wikibase™ contributor, how to use templates (not how to write them!) and, perhaps more importantly, how to interpret the arcane chicken scratches Bludwyng calls documentation.
What is a Template?
A template is just a wiki page, same as any other, but it lives in the Template: namespace so that the system knows that it can be transcluded in other pages. To make them more flexible and generally useful, there is a whole group of special commands that can be used to conditionally transclude the contents so that the template becomes aware of the context it finds itself in.
What is transclusion?
Transclusion is just a fancy word they came up with that means the template is semi-interpreted, or translated, then the result is included in the page that called it before that page is compiled.
Why do I want to use Templates?
Because templates make it possible for us to enforce certain style-guidelines across the entire Wikibase, and allow us to group together content that needs to be used in many places so all we have to remember is the template name and not what all that stuff inside it means.
Where can I find their names and what they do?
Bludwyng has thoughtfully put together a set of guides, by game, that list all the templates he has created that pertain to that game, along with one for templates that apply to the entire Wikibase.
How do I call a Template?
Very similar to the format for linking to a page, but template calls use curly braces instead of square brackets. Here is the general form of a template call, in what programmers call a syntax diagram:
{{TemplateName|value|value|name=value}}Parameters being passed to a Template can be named or unnamed, and are separated with the pipe symbol, |. Unnamed parameters are numbered in the order they are encountered but named parameters use the name they are assigned. This is important because as a template designer, Bludwyng tries to mix and match named and unnamed parameters (or fields) in the most efficient way to make the template the easiest to use. If you see an equal sign, whatever is to the left is the parameter name and must not be changed! Whatever is to the right, up to the next pipe or the final curly braces, is the value.
Templates can also be called on multiple lines. The call starts with the double left curly braces, then has the name of the template, then the parameters and ends with a pipe and 2 right curly braces. Notice that a parameter does not have to have a value! It can be blank, or even undefined!
{{TemplateName|value
|name_1=value
|name_2=
|}}Why the pipe before the ending braces, and why only on vertically-defined calls? - This is a little peccadillo of our wiki implementation. If you don't add the pipe the previous parameter will be passed with a linefeed on the end of it which seriously messes up most templates!
Can you be less technical?
Not very, so long as we are talking in generalities, so let's get specific. Here is a call with no named fields, just numbered ones. I will show you the usage diagram first, then the call with real values in it, then what it looks like when used on a page.
Usage: {{WoW Coin|gold|silver|copper}}
{{WoW Coin|1|2|3}}This renders as: 1
2
3
![]() The Relentless Fae Wizard Lucan D'Lere EverQuest II | Bludwyng, ZAM Network Sr. Wikibase Admin | |
|
||
| All the power in the universe in a small, flaming fairy, package. | ||
Home