Help:Templates


 * See also: Help:Templates on MediaWiki

A template is a page made to be included in other pages. They standardize content or formats that need to be repeated on many pages, by encapsulating them in a separate page in the. They can abstract away complicated syntax, namely.

Templates are most often used by. That is, by enclosing the name of the template page in. When placed in another page, the entire contents of that template page will be displayed where you placed it. Templates can have s that modify their appearance or content.

An example of a common template is an infobox, such as Template:Infobox Item. Infobox templates appear in the upper right corner of nearly every article on the wiki. There are many other types of templates.

Parameters
Templates can have anonymous parameters, named parameters, or both. With anonymous parameters, order matters.

Template:Item Amount is a template with anonymous parameters. It is used like this:, which produces. You wouldn't get the right output if you changed the order of the parameters.

Template:Clarify is a template with both anonymous and named parameters. It is used like this:. There's one anonymous parameter for the game, and a named  parameter for the display text.

Transclusion and substitution
Templates can be used by or by. When you transclude a template on a page and save it, the source will still show  when you go back to edit it. Conversely, when you substitute a template, the actual contents of the template gets copied and saved to the page.

In reality, Template:MM outputs something quite different when substituted, but this illustrates the point.

Generally, templates should be substituted and not transcluded. Substitution does not preserve a reference to the template—it's like you didn't use a template at all. You lose the ability to have the content update automatically when you change the template.

Making Templates
For information on how to make templates, see Zelda Wiki:Making Templates.