Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Excerpt Include Parent Page

Hello Community,

maybe you can help me out.

I need to select parent page as a value on the excerpt include macro.

I have a lot of pages that contains content, which will change from time to time. I have a create from template macro on all of these pages. The idea is that the new generated child page will pick up a part of the content from the parent page. For this to work, I need to select the value "parent page" in the confluence template that I created.

All I need is the exact same macro, just with this additional one option.

Is there a way to select parent page on the existing macro or do I need to create a user macro. If so, can someone help me with this. Can I somehow extract the macro code from "excerpt include"?

 

Kind regards

Alex

1 answer

1 accepted

0 votes
Answer accepted

Figured it out - if you need it you can copy past it. :)

 

## Developed by: Felix Schäfer & Alexander Wirtz
## Date created: 07/12/202

## @noparams

#set($parentId = $pageManager.getPage($content.id).parent.getContentId().asLong())
#set ($requestedPage = $pageManager.getPage($parentId).getTitle())

#if ($parentId)

<ac:macro ac:name="excerpt-include" ac:schema-version="1">
<ac:parameter ac:name="nopanel">true</ac:parameter>
<ac:default-parameter>$requestedPage</ac:default-parameter>

</ac:macro>

#else
Cannot show tasks on parent page because this page has no parent.
#end

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

43,247 views 31 134
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you