Help:Template
A template is a wiki page whose contents are specially intended to be inserted into another wiki page by the "transclusion" process. When you use a template, the template name is surrounded in double curly braces: {{NameOfTemplate}}.
If you're interested in using templates, just keep reading. If you're interesting in creating them, see the Creating Templates section of this page.
Using Templates
Passing Parameters
Named Parameters
Named parameters are parameters which have a name to them. For example, the {{DomainPage}} template uses named parameters. To use the DomainPage template, you would use code such as the following:
{{ Domain_Page |
reviews = <reviews></reviews> |
vote = <vote></vote> |
thumbnail = <thumbnail>AboutUs.org</thumbnail> |
map = <map section="Address"></map>
}}
Do not be confused in this example - the tags being passed, such as <reviews></reviews>, are not necessary to pass named parameters. The tags themselves are being passed to the template.
In this example, reviews, vote, thumbnail, and map are all named parameters, because you must specify their name. Named parameters need to have an equal sign ( = ) between the name of the parameter and the value.
| ) at the end of each line. This separates the previous parameter from the next. Now you are probably thinking, "then why do we need a pipe if we need to place the parameters on separate lines?" The thing is, you don't have to put them on separate lines. You can if you want. This template could be condensed into one line:
{{ Domain_Page|reviews = <reviews></reviews>|vote = <vote></vote>|thumbnail = <thumbnail>AboutUs.org</thumbnail>|map = <map section="Address"></map>}}
Sequential Parameters
Sequential parameters do not have a name to them. It all matters in what order you pass them. For example, the {{color}} template engages sequential parameters. To use this template you would use:
{{color|Black|Blah blah blah blah blah.}}
Because this template is using sequential parameters, switching the two around (Black) would not give the desired output.
But then, how would you skip a parameter? Very simple. Simply leave a blank value. For example, Blah blah blah blah blah. (notice that the color parameter is skipped).
Of course, sequential parameters, like named parameters, must be separated by a pipe. And just like named parameters, you could place the parameters on separate lines.
Hanoi PhuDo hotel.
