Can you use a variable with include-page macro?

I have a page that I need to render inside the parent page. The parent page is created with a template, so I won't know the exact name of the child page until it is created. Is it possible to do something like this:

{include-page:title=%pagetitle% Color}

So, if you are on page 'Apple' the page you are rendering inside 'Apple' would be 'Apple Color.'

4 answers

I think there are a few ways of doing this either using the reporting plugin or the Confluence Run Plugin with the run-now macro and the $page_title pre-defined variable.

{run-now}{include:$page_title Color}{run-now}

How can I do it with the run-macro in a template? When the page is named 'Apple', this works in the template:

{include:Apple}

This works as well, somewhere in my template:

{run-now}$page_title{run-now}

But this doesn't work:

{include:{run-now}$page_title{run-now}}

If you have the Reporting plugin then you can use injection and the %...% syntax you suggested in your post. Something like this should work (untested) : {report-on:injection=true}{include-page:%page:parent > page:name% Colour}{report-on}

I have the idea this doens't work anymore with Confluence 5. 

(it does with unmigrated wiki-markup).

Anybody know what changed?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

95 views 0 6
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