Variables in a Confluence page name

I have a page named "1.0" that uses the Expand and Include Page macros to show a child page named "A Child 1.0"while staying in the parent page. Works nicely. But now I copy the parent page to a new page named "1.1" and the child page to "A Child 1.1". I have to edit the new parent page so it doesn't include the old "A Child 1.0" page. This is quite a bit of work when there are many children. I don't want to use a new space for each version.

So the question is whether there's any way to use a variable in the name of the page to be included? I want to say "Expand: Include Page: A Child %myvar%" and then define %myvar% somewhere on the parent page.

I've poked around the open issues for this at JAC, didn't see any progress on them there.


3 answers

You could use the Run-now macro and the $page_title pre-defined variable to construct the child title. That will work for simple concatenation for child names. Otherwise, you would need a script or something else. The reporting plugin might have something similar as well.

Hi Matt,

As Bob suggests, the Reporting plugin (by your own company) will be able to pick out a variable created on the parent page, in the form of a scaffold field. You can then inject this into the include macro. Alternatively you could take the name of the current page and inject that. The mark up will be something similar to this (untested):

{include:A child %page:title%}

Hope that helps,


I think the easiest thing to do is create a user macro with the other macros inside. That way you can set a parameter in the macro browser and that parameter can set the variables.

Or you can add variables to templates. If you create a page from a template you can add your values to the variables before the page is initially built.

Could you expand on this?

I've tried the 2nd option you suggest. Using the "Create from Template" macro to call my own template that has variables you select for the page title. But when it builds the page the title isn't filled out.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

284 views 2 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you