Help:Templates

From WaterWiki.net

Jump to: navigation, search

The template feature is especially useful if you want to include standard text on multiple pages. Templates are designed to be transcluded (embedded) inside other pages. They follow a convention that the name is prefixed with "Template:", assigning it to that namespace. Therefore templates are created in the same manner as any other waterwiki page.


Organising Templates

For templates to be effective users need to find them and be able to use them. A simple technique is to include an example on the template page.


Using a template

There are 3 main ways that templates can be included in other waterwiki pages:

  1. {{Name}} 'transcludes' (i.e. includes a copy of) the content of the template (stored in the page [[Template:Name]]) whenever the page containing the template transclusion is fetched and displayed; i.e. if the template is later changed, the displayed transcluding page will automatically change too.
  2. {{subst:Name}} replaces that string with the contents of the template, in the source of the transcluding page, when you save that page; the copy of the template contents can then be edited normally (and separately from the original in the template page).NB:Don't use this if you are looking to continually propagate changes from the source template to the page(s) that references it.
  3. [[:Template:Name]] includes the template in a form that displays it as raw wiki syntax (the way does) when the page containing it is fetched


The following is an example of a template used on waterwiki:

edit Help
Getting Started | A step-by-step guide | MediaWiki handbook]
Related resources: WaterWiki Toolkit