Using Add page macro to create pages containing Live Templates

Scenario

You might want to guide Confluence users in creating content by providing one-click links to create pages with a structured layout. These auto-generated pages can:

Result

Recipe

Apps

 

Linking for Confluence Cloud, Scaffolding Forms & Templates for Confluence Cloud

 

Apps

 

Linking for Confluence Cloud, Scaffolding Forms & Templates for Confluence Cloud

 

Platform

Cloud

Level

Easy

Estimated time

5 minutes ⏱

Macros

Add Page

Storage format

You can copy and paste this code into the Confluence Source Editor:

N/A

Macro structure

You can recreate the example in the editor view:

Steps

  1. In the page, create an Add Page macro.

  2. For the Create Link Text parameter, enter text for the link e.g. "Create a new project page". Users will see this text when viewing the link on the page. 

  3. To decide what will happen when a user clicks on the link, specify the source parameters:

    • Source type is set to "page" since it is based on a Confluence page.

    • Source parameter determines the name of the Confluence page to use. E.g. "Page with Live Template"

     

  4. Tick the Live Template checkbox. 

  5. Expand the Configure page title prefix/postfix and make use of the Prefix and Postfix parameters.

  6. In this example, we add "$id(000,1)" as prefix, so all page titles will start with "001 - (Name of Page)". This number will increase incrementally. 

  7. To ensure an organized space, make use of the Parent parameter, which tells Linking where to create the page. This is useful for automatically categorizing the pages. Leaving it default, will make the current page you are adding the macro the parent page. For this example, we are using "Project Catalogue". 

  8. You can also automatically add label(s) to the pages. For this example, we specify "project-key" in the Labels parameter.

  9. Click on the cross button or click on the page to save the changes. Repeat the previous steps as needed, then Publish the page.

Make sure the Source page being used has the Scaffolding Live Template included within

 

Line-by-Line Explanation

N/A