how to create a template in confluence

How to Create a Template in Confluence

By Hannah Moore
AD

Creating a reusable template in Confluence can significantly boost productivity by streamlining your content creation process. Here's a comprehensive guide on how to create and customize templates in Confluence.

Before we dive into the details, ensure you have the 'Create and Edit Pages' permission. If you're a space administrator, you can enable the 'Page Template' macro for your space.

Creating a Basic Template

Starting with the basics, let's create a simple template that others can use when creating new pages.

AD
Create engaging Confluence pages in 4 easy steps - Inside Atlassian
Create engaging Confluence pages in 4 easy steps - Inside Atlassian
How to Make Your Confluence Pages More Attractive
How to Make Your Confluence Pages More Attractive
Summaries using the page properties report macro in Confluence
Summaries using the page properties report macro in Confluence

1. Click on 'Create' in the top navigation bar and select 'Page'.

Define the Template Structure

Begin by adding titles, text, and other content blocks as needed. You can use Confluence's rich text editor to format your content. Don't include any dynamic or unique information that should change with each use of the template.

Confluence Tutorial: Build a Project Portfolio Dashboard
Confluence Tutorial: Build a Project Portfolio Dashboard
How to Make Your Confluence Pages More Attractive
How to Make Your Confluence Pages More Attractive
Six Confluence features you should be using
Six Confluence features you should be using

2. Once you've set up the content, click 'More actions' (three dots) at the top right corner, and select 'Convert to template'. Name your template and hit 'Convert'.

Using and Customizing the Template

Your teammates can now use this template to create new pages. To do so, on the 'Create' dropdown, select 'From template' and choose your template.

AD

1. They can customize the content by editing the text, adding images, or using macros. To change the structure, they can click the 'Edit source' button at the bottom of the edit screen.

Create a kick ass Confluence user interface your team will want to use
Create a kick ass Confluence user interface your team will want to use
Confluence Tutorial for Beginners: How to Use Confluence
Confluence Tutorial for Beginners: How to Use Confluence
Lenny's Product Requirements template | Confluence
Lenny's Product Requirements template | Confluence
Create a team page in Confluence - Light Many Fires
Create a team page in Confluence - Light Many Fires
How Modus Create turned Confluence into its virtual office
How Modus Create turned Confluence into its virtual office
Vorlage "Lerne das Team kennen"-Vorlage | Confluence
Vorlage "Lerne das Team kennen"-Vorlage | Confluence

Adding Dynamic Content with Text_REST

The 'text/rest' macro allows you to add dynamic content to your templates. This content can be parameters that change with each page created from the template.

To use 'text/rest', you'll need some basic familiarity with REST APIs. Here's how to add a parameter:

AD

Adding a Parameter to Your Template

1. In the template editor, click on 'Insert' in the rich text toolbar, then select 'Other macros'.

confluence wbs template
confluence wbs template
Confluence: AI Workspace for Knowledge & Collaboration
Confluence: AI Workspace for Knowledge & Collaboration
7 Steps to Build a Custom Confluence Intranet
7 Steps to Build a Custom Confluence Intranet

2. Choose 'Text REST', and enter the URL and query parameter you want to use. For example, if you want to fetch a list of users, you could use `"/rest/api 쓰지weit/1.0/users?limit=50"`.

Using Parameters in Your Template

1. Now, you can use the parameters in your content. Wrap the parameter name in curly braces, like this: `{username}`.

AD

2. When someone creates a new page from your template, they can fill in the parameter values, and Confluence will fetch the dynamic content from the REST API.

Adding Additional Functionality with Scripting

For more complex use cases, you can use Groovy scripts to add dynamic content to your templates.

1. Insert a 'Script' macro into your template, and write your Groovy code. This code should create the dynamic content you want to include.

Accessing Global and Page Properties

1. You can use the 'currentPage' object to access data from the current page, like labels or attachments. To access global properties, use the helpers provided by the 'currentPage' object.

Running Scripts When a Page is Created

To run a script every time a new page is created from your template, use the 'On Create' trigger. In your script, set the 'trigger' property to 'On Create'.

Finally, remember to keep your templates secure. Ensure only authorized users can access and use your templates. You can do this by managing template permissions at the space level or by using blueprints.

AD