Difference between revisions of "Help:Templates"

m
Templates are enclosed by double curly braces (<code>{{</code> and <code>}}</code>). The ''template name'' comes first, followed by ''parameters'', all separated by vertical bars (<code>|</code>). It looks something like this: <code><nowiki>{{name|param1|param2|param3}}</nowiki></code>.
 
Note that some templates are entered in a single line of text, like the example above. This is common for reference templates and those which don't require any parameters. However, it is not uncommon for templates to span multiple lines, for the sake of clarity. Something more like:
 
<pre style="white-space:pre-wrap; width:100px">
 
=== Parameters ===
There are two kinds of parameters: '''named''' and '''unnamed'''. Named parameters are identified by the name of the parameter while unnamed parameters are identified simply by the order they appear.
 
;Named Parameters
: ''Named parameters'' require the parameter name and an equals sign (<code>=</code>) followed by your input. If <code>param1</code> is a named parameter of {{t|example}}, and you want the input to be "Mistborn", then you will enter <code><nowiki>{{example|param1=Mistborn}}</nowiki></code>.
 
;Unnamed Parameters
: ''Unnamed parameters'' should be completely replaced by your input. If <code>param1</code> is an unnamed parameter of {{t|example}}, and you want the input to be "Mistborn", then you will enter <code><nowiki>{{example|Mistborn}}</nowiki></code>.
 
=== Example ===
Editors, Keepers
4,418

edits