Help:Templates

From NMR Wiki

Jump to: navigation, search

Templates are re-usable pages, whose content can be included into regular wiki pages and even into other templates.

Template page have "Template:" prefix
(this prefix actually means that this page belongs to "Template" namespace)

Inserting a template into a page

Type {{template-name}} into the page where you want to insert a templated message and save.

If the template with that name already exists - then you're done. If it does not exist - you will see a red link with title "Template:Template-name".
Just follow the red link and create the template's content.

More help on templates is here (Link to Mediawiki website)

Templates can also take parameters, which is not explained yet on this page.

Where to find templates

Templates are categorized under Category:Templates.

Naming templates

Also we stick to a convention for template title naming: use all lower case hyphenated words. (Again, first character in title is always displayed upper case, but you can type it in lower case)

Templates with parameters

Some templates accept parameters.

Those are name=value pairs separated by a vertical bar | symbol, like so:

{{template-name|par1=value1|par2=value2}}

Everything that goes after the template name and the first | symbol are template parameters.

Values of parameters can be edited. Names are fixed within the template and therefore - cannot be chosen freely.

Example

page Template:He-warning is our template containing warning about hazards of Helium gas and liquid.

To include it in some page, type {{he-warning}} right at the place you want the warning to appear.

Notice that first character is case insensitive.

Personal tools