Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can you use a variable with include-page macro?

Rhyne Armstrong April 29, 2012

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

0 votes
Deleted user September 17, 2014

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

(it does with unmigrated wiki-markup).

Anybody know what changed?

0 votes
CharlesH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 13, 2012
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}
0 votes
Stefan Eike
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 12, 2012

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}}

0 votes
Bob Swift
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 30, 2012

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}

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!

Help us plant more trees
AUG Leaders

Atlassian Community Events