Edit source Discussion

Help:Templates

From Appropedia
Page data
Authors RichardF
Published 2013
License CC BY-SA 4.0
Derivatives Ayuda:Plantillas
Automatic translations

A template is a reusable snippet created to be included in other pages via the transclusion mechanism.

Some template examples[edit source]

Templates can be used for several purposes:

The templates are contained in the namespace template, i.e. the namespace whose pages have the form Template:NAME (for example Template:User data). You can check the full list of available templates Category:Templates (link at the bottom).

How to add a template[edit source]

All pages belonging to the namespace template can be quickly inserted into a page, simply by writing the template name in double curly brackets, as in {{NAME }}. This causes the content of the template to be inserted when the page is displayed. If the Template:name page doesn't exist, then {{Name }} works as [[Template: name]], and a redlink to a non-existent page will lead you to create the template.

How to edit a template[edit source]

To edit a template, you need to open it in edit mode. Simply going to the template page, depending on how it is set up, you'll get in the most common cases an instruction page, sometimes accompanied by a warning that marks the most complex and difficult to modify templates. Editing a heavily invoked template can damage numerous pages, as well as overloading the servers, which have to update all the pages that include it. For this reason, try discussing any changes to important templates with the community before doing so.

HelpTemplates.png

How to create a template[edit source]

Templates reside on the Template namespace of Appropedia. Depending on its objective, you can either transwiki them from other wikis such as Wikipedia, or program its functionality from scratch. It's always a good idea to insert the categories to which the template belongs when you're creating a template, a short instructional text, and a presentation of the template functions between certain tags. The actual template code needs to be wrapped within <nowiki></nowiki> tags, to prevent a meaningless result from being shown on the template page itself.

Usage[edit source]

Templates are useful for any complex element, especially with graphic formatting, which needs to be repeated in two or more pages without having to type it each time. They are not only convenient but can help achieve consistency between pages.

See also[edit source]