Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Overview

Excerpt

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:

(info) Global templates can only be created by site administrators, and space templates by space administrators.

Here is an example:

Info
titleNote

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

Zones Plugin

Scaffolding Plugin

Description

Basic

Flexible

Powerful

Saves page version history

(tick)

(tick)

(tick)

Allows return to form version

(error)

(tick)

(tick)

Suitable for dynamic data

(error)

(error)

(tick)

Has a library of examples

(error)

(error)

(tick)

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.

Tip
titleLabels 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

Panel
borderColor#ccc
bgColor#d5efff
titleBGColor#F7D6C1
borderStyledashed
  1. Click the 'Add Page' link located beside each space on the dashboard or at the top of every page in Confluence.

  2. 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.

  3. 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.
  4. 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.
  5. Replace the words 'New Page' with the name of the page.
  6. Add more content or make further changes as required.
  7. 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,

Panel
borderColor#ccc
bgColor#d5efff
titleBGColor#F7D6C1
borderStyledashed
  1. 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.
  2. Go to the 'Advanced' tab then click the 'Templates' option in the left navigation panel.
  3. Click 'Add New Space Template'. This will bring up the 'Create Template' screen.
  4. Enter a name for your template in the 'Name' text field and an optional description in the 'Description' text field.
  5. 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:





  6. 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.
  7. Preview and click 'Save'. Your template will be added to the list of space templates.
  8. To view the space templates, browse the space then click the 'Templates' option in the left navigation panel of the 'Advanced' tab.
For more information, check out this example template.