Overview
You don't have to make a page from scratch.
A template is essentially a page with pre-populated content. Templates may be written in regular Confluence markup, or using special markup if you wish to define form fields to be filled in.
Some examples:
- A software development project may have a template for use-cases.
- A systems administration space may have a template for defining what information is kept about each server.
In Confluence, there are two places to store your templates:
- Global Templates : These are defined by site administrators through the Administration Console and are available in every space.
- Space Templates: These are defined by space administrators in the space administration screens, and are only available in the space in which they are defined.
Global templates can only be created by site administrators, and space templates by space administrators.
Here is an example:
Note
Currently, templates can only be used to create a page. Once a page is created, the template is gone and all further editing is performed as if the template was never used. Some plugins provide expanded functionality for strictly templated content. See below for more information.
Important Plugins For Templates
Two popular plugins that expand on template behaviour are the Zones Plugin and Scaffolding Plugin. Below is a comparision:
Field |
Default |
||
---|---|---|---|
Description |
Basic |
Flexible |
Powerful |
Saves page version history |
|
|
|
Allows return to form version |
|
|
|
Suitable for dynamic data |
|
|
|
Has a library of examples |
|
|
|
Creating a Page from a Template
Confluence allows you to create a page based on a global template (available to all spaces) or a space template (available only to that space). This page is intended for users who have already created a template.
Labels are copied from template
If the template contains labels, the template labels will automatically be included in the new page created from that template.
To create a page from an existing template
- Click the 'Add Page' link located beside each space on the dashboard or at the top of every page in Confluence.
- Click the link 'Select a page template' located above the text-entry box.
This is only displayed if there are any templates defined. If you do not see this link, then there are currently no templates defined and an administrator will have to create one before you can use it.
Clicking this link will display a list of the templates that are available in the current space.
- Select a template and click 'Next'. This will display one of the following:
- A new page based on the template, if the template does not contain a form.
- The 'Template Variables' page where you can supply values for the variables, if the template contains a form.
- If the template uses a form, enter the appropriate values into the form fields and click the 'Insert Variables' button. This will display a new page based on the template and including the variable values you have entered.
- Replace the words 'New Page' with the name of the page.
- Add more content or make further changes as required.
- Click the 'Save' button.
Screenshot : Choose a template
Screenshot : Fill out the form
Screenshot : Resulting page
Adding a Template
You need to be a space administrator to create a space template.
To add a template for a space,
- Click the 'Browse Space' link for the space. This is located at the top of every page and beside the space link on the dashboard.
- Go to the 'Advanced' tab then click the 'Templates' option in the left navigation panel.
- Click 'Add New Space Template'. This will bring up the 'Create Template' screen.
- Enter a name for your template in the 'Name' text field and an optional description in the 'Description' text field.
- Using regular Confluence markup and form field markup (if you are using forms), enter content in the text-entry box as you would in any other Confluence page. For example:
- Click 'edit' next to 'Labels' if you want to use labels to categorise information. Add your labels. These labels will be included in all pages created using this template.
- Preview and click 'Save'. Your template will be added to the list of space templates.
- To view the space templates, browse the space then click the 'Templates' option in the left navigation panel of the 'Advanced' tab.