A template is a predefined page that can be used as a framework when creating new pages. Templates are useful for setting a common style or format for a page.
In Confluence, there are two places to store your page templates:
Space templates are available in one space only.
To add a template for a space:
If your space uses the Documentation theme:
confluence-administrators
group).
The 'Create Template' screen will appear. Add content as described below.
Global templates are available in all spaces in your Confluence site.
To add a global template:
The 'Create Template' screen will appear. Add content as described below.
This illustration shows the template editor with an image, some text, styling, and variables.
This screenshot shows the form displayed when someone creates a page based on the template containing the above variables. (See Creating a Page using a Template.)
Add a name for your template.
Enter text into the body of the template, and use the editor toolbar to apply styles, layout and formatting. You can add links and macros. In general, you can use the Confluence editor in the same way as on a page. In addition, you can add variables which will produce a form for data collection when someone adds a page based on the template.
Below are some points of special interest in templates.
Choose Labels to add one or more labels to the template. These labels will be included in all pages created using this template.
For example:
You can add variables to your template, to act as form fields. When someone creates a page based on the template, Confluence will display a text entry box for each field. The user can enter data into each field, and the data is inserted onto the new page.
Every variable must have a unique name. If you add the same variable more than once in the same template, Confluence will make sure that they have the same value when the user saves the page. This is useful if you need the same information in more than one place in the page.
To insert a variable into a template:
Speeding up variable entry with autocomplete: Type $ and the variable name, then press Enter, to add a new variable or to select an existing variable from a list of suggestions. The suggestions are drawn from variables already defined in this template.
These are the types of variable available:
Variable type | Description |
Text | Creates a single-line text input field. Screenshot: A template variable called |
Multi-line text | Creates a text box that allows more than one line of text. By default, the text area is 5 rows depth and 100 characters wide. You can change the size by typing over the digits in the variable property panel. Screenshot: A multi-line variable and its property panel |
List | Creates a dropdown list. You must specify the values that will appear in the dropdown list. The values:
Screenshot: A list variable and its property panel |
Instructional text allows you to add placeholder content to a template. This text is only visible in the editor and disappears when the author of the page begins typing.
To insert instructional text into a template:
You can also change the placeholder type from 'text' to other types, including some that trigger an action such as a user mention or creating a JIRA issue.
The following instructional text types are available:
Instructional text type | Description |
---|---|
Text | Creates a line of text that is only visible in the editor. Instructional text disappears when the user begins typing. |
User Mention | Creates a line of text that is only visible in the editor. When clicked it triggers the @mentions dialog. |
JIRA Issue | Creates a single link of text that is only visible in the editor. When clicked it triggers the JIRA Issues macro dialog. Users can then search for or create a new issue. |
The template description displays in the 'Create' dialog and is useful for explaining the purpose of a template to users.
To add a description to a template:
If you would like to convert an existing page to a template, you can copy the content from the page and paste it into the template editor. There is no automated way of doing this.
Please note the section above about images and other attachments in templates.