Use links to create pages from Confluence templates

Use links to create pages from Confluence templates

Scenario

You may want to guide users in creating content in Confluence by providing a one-click link to create a page with a structured layout:

  • Automatically use a Confluence template as the base structure

  • Automatically suggest a page title

  • Automatically categorize a page under a parent page

  • Automatically add labels to the page

You can also apply this to Scaffolding live templates. See Use links to create pages with Scaffolding live templates.

Result

Recipe

Apps

 

Linking for Confluence

 

Platform

Server and Data Center

Level

Easy

Estimated time

5 minutes

Macros

Add Page

Suppliers

N/A

Storage format

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

<h3>Product Catalogues</h3> <hr/> <p> <ac:structured-macro ac:macro-id="3417a97b-c0d4-4f1d-8d86-b45231cb688d" ac:name="add-page" ac:schema-version="1"> <ac:parameter ac:name="parent">Products</ac:parameter> <ac:parameter ac:name="prefix">Product - </ac:parameter> <ac:parameter ac:name="linkText">Create a new Product</ac:parameter> <ac:parameter ac:name="source">Product template</ac:parameter> <ac:parameter ac:name="labels">product</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="7b7af786-9714-436e-bf32-d00ee45e2176" ac:name="add-page" ac:schema-version="1"> <ac:parameter ac:name="parent">Product Suppliers</ac:parameter> <ac:parameter ac:name="prefix">Product Supplier - </ac:parameter> <ac:parameter ac:name="linkText">Create a new Product Supplier</ac:parameter> <ac:parameter ac:name="source">Product supplier template</ac:parameter> <ac:parameter ac:name="labels">product-suppliers</ac:parameter> </ac:structured-macro> </p> <p> <ac:structured-macro ac:macro-id="1fad6390-a12d-4833-b63e-2f1447f2cd55" ac:name="add-page" ac:schema-version="1"> <ac:parameter ac:name="parent">Contracts</ac:parameter> <ac:parameter ac:name="linkText">Create a new Contract</ac:parameter> <ac:parameter ac:name="source">Contract template</ac:parameter> <ac:parameter ac:name="labels">contract</ac:parameter> </ac:structured-macro> </p>

 

Macrostructure

You can recreate the example in the editor view:

Steps

  1. Create an Add Page macro.

  2. For the parameter Create Link Text, enter the link title, for example, Create a new Product.

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

    1. Source parameter determines the name of the Confluence template to use. For example, Product template.

    2. Source type is set to template since it is based on a Confluence template.

  4. For the Prefix parameter, enter Product - , so all page titles will start with Product - <Name of product>.

  5. To ensure an organized space, use the Parent parameter, which defines where Linking to create the page. Useful to automatically categorize the pages.

  6. You can also automatically add label(s) to the pages. For this example, we specify product for the Labels parameter.