Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,316
Community Members
 
Community Events
176
Community Groups

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

Where exactly do you paste this?

I cant get it to work.

Hey Ashley, you have to create a custom user macro in the configuration. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS

Atlassian Community Events