Skip to main content

πŸ“‚ Smart Variables

Smart Variables brings rich, dynamic content to your Confluence pages. By inserting variables like {{space.status}} or {{page.author.displayName}}, you can pull live data about your Confluence spaces and pages directly into your content.

The macro's template engine is compatible with Handlebars syntax, so beyond simple variable interpolation you can use conditionals ({{#if}}), loops ({{#each}}), and other Handlebars block helpers β€” see the Template Syntax guide.

Use the Smart Variables macro to:

  • Display live space and page information.
  • Build dynamic page catalogs.
  • Create and manage rich content workflows.

All macro content is fully exportable as part of your Confluence page to PDF or Word formats, preserving the dynamic values at the time of export.

Key Features​

1. Dozens of Variables Supported​

Enhance your content with an extensive set of variables. Examples include:

  • Space Variables
    • {{space.status}}: Current status of the space.
    • {{space.name}}: Name of the current space.
  • Page Variables
    • {{page.author.displayName}}: Name of the page author.
    • {{page.createdAt}}: Creation date of the page.
    • {{page.currentVersion.number}}, {{page.previousVersion.number}}: The current and previous version numbers of the page.

2. Handlebars-Compatible Template Engine​

The macro compiles content with Handlebars syntax, so you can go beyond plain variable interpolation with:

  • Conditionals: {{#if}}, {{#unless}}
  • Loops: {{#each}}
  • Helper functions: {{formatDate ...}}, {{uppercase ...}}, and more

See the Template Syntax guide for full examples.

3. Dynamic Content on Any Page​

Add the macro to any page to transform it with live data. Perfect for:

  • Space dashboards
  • Knowledge base catalogs
  • Personalized documentation templates

4. Seamless Export​

The macro content seamlessly integrates with Confluence's export features:

  • Export as PDF: Includes the macro output for professional documentation.
  • Export as Word: Preserve dynamic content for editing and sharing.

Getting Started​

Step 0: Install the App​

Install Smart Variables from the Atlassian Marketplace.

Step 1: Insert the Macro​

  1. Edit your Confluence page.
  2. Click on Insert More Content (+).
  3. Search for Smart Variables and select it.

Step 2: Configure Variables​

  1. Enter the desired variables into the macro, e.g., {{space.status}}.
  2. Preview the output directly on the page.

Step 3: Save and Share​

  1. Save the page to see the dynamic content live.
  2. Export the page as needed with all macro content included.

Use Cases​

Space Dashboards​

Create a centralized view of your space status, activity logs, and more.

Team Documentation​

Personalize content by automatically including author details, creation dates, and other metadata.

Content Catalogs​

Build dynamic page catalogs with live updates for streamlined content management.

For a full list of supported variables, check our Variable Reference Guide. For conditionals, loops, and helper functions, see the Template Syntax guide.