From Wiki

Jump to: navigation, search

Contents

Using templates in a Wiki

If you are expecting to see similar elements on each page of your Wiki, you might want to consider using a template page and referring to it. You may reference more than one template on the same page.

Using a template requires two essential elements: a template page and a reference to the template.

Template page

A template page is a wiki page with the desired markup. A template page is referred to with the naming convention of "Template:Name". Name would be the unique reference. Within the template page, special variables can be created called parameters. These parameters could accept input unique to a page where it will be displayed. For example, you could create a heading that is large and red by creating a template page called "Template:Title" with this code:

==<span style="color= red">{{{title}}}</span>==

{{{title}}} would be the parameter being passed.

Template reference

On a page where I would like to use the template, I would include this tag: {{Title}} or more specifically, I would include {{Title|title=This is my title}}. The first item is the template, and the second item is the information for the parameter. Here is how it would actually look on a page:

This is my title

Here are more template examples and information.


Return to Informal Learning:Wikis