Adding a Template
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: These page templates are available in a specific space only. People who have
- Global templates: These page templates are available in every space on the site. People who have Confluence Administrator permission can define the global templates via the .
Adding a space template
Space templates are available in one space only.
To add a template for a space:
- Go to the space and choose Space tools > Content Tools on the sidebar.
- Choose Templates > Create new template.
If your space uses the Documentation theme:
- Choose Browse > Space Admin at the top of the screen.Note: The 'Space Admin' option appears only if you have space admin permissions for the space or you have System Administrator global permissions.
- Choose Templates from the space administration options.
- Choose Create new template.
The 'Create Template' screen will appear. Add content as described below.
Adding a global template
Global templates are available in all spaces in your Confluence site.
To add a global template:
- Choose the cog icon , then choose General Configuration under Confluence Administration.
- Choose Global Templates and Blueprints in the left-hand panel.
- Choose Add New Global Template.
The 'Create Template' screen will appear. Add content as described below.
Using the template editor
This illustration shows the template editor with an image, some text, styling, and variables.
The resulting form when the template contains 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.)
Adding content to your 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.
Images and other attachments
- You can attach an image to a page and then choose Insert > Image to embed the image into the template.
- You can attach a PDF to a page and then choose Insert > Other Macros > PDF to embed the PDF into the template.
Variables used as form fields
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:
- Place your cursor on the template where you want the variable to appear.
- Choose Template > New Variable from the editor toolbar. Alternatively, you can choose the name of an existing variable if you want the same variable to appear more than once in the template.
- Enter the variable name.
- Press Enter. By default this will create a single-line text input field.
- To change the variable type, click the variable placeholder. The variable's property panel will appear. Choose one of the variable types: Text, Multi-line Text, or List. See below for a description of each type.
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:
Creates a single-line text input field.
Screenshot: A template variable called
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
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:
- Place your cursor on the template where you want the instructional text to appear.
- Choose Template > Instructional Text on the editor toolbar.
- Begin typing - the instructional text appears in italics with a shaded background to distinguish it from normal paragraph text.
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|
Creates a line of text that is only visible in the editor. Instructional text disappears when the user begins typing.
Creates a line of text that is only visible in the editor. When clicked it triggers the @mentions dialog.
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.
Adding a description to your template
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:
- Go to the space or global templates page (as described above).
- Choose the Edit icon in the 'Description' column.
- Enter your description and save.
Converting an existing page 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.
- You cannot insert variables via the 'Insert wiki markup' option in the editor toolbar.
Page templates are used only when adding a page. It is not possible to apply a template to an already-existing page. Once a page has been added using a template, the template is no longer linked to the page. All further editing is performed as if the template was never used. Some plugins provide enhanced template functionality. You can search the Atlassian Marketplace for template add-ons.
- When you use a Table of Contents macro in a template, you will see an error when you preview the template itself. But the Table of Contents macro works on the pages that people create from the template – the table of contents shows up after they have saved the page. (This is probably because the template is not defined as a page, and the Table of Contents macro works for pages only.)
- The editor for templates is available only in Confluence 4.3 and later. Please refer to the earlier documentation for a description of the wiki markup editor templates.
- Confluence also provides 'system templates' containing content like the site welcome message and default space content. See Administering Site Templates.
Was this helpful?
Thanks for your feedback!