hello guys, i need your help :-)
i want to include the content "123" from the parent page. If i use the excerpt macro i have to define the "page with excerpt", how can i define this without knowing the exact name of the parent "master-page"?
I mean, if someone creates a new page below "Master-Page-123" it should automatically reuse the content of the parent "Master-Page-123".
I created a custom user macro for this:
## Developed by: Felix Schäfer & Alexander Wirtz
## Date created: 07/12/202
#set($parentId = $pageManager.getPage($content.id).parent.getContentId().asLong())
#set ($requestedPage = $pageManager.getPage($parentId).getTitle())
<ac:macro ac:name="excerpt-include" ac:schema-version="1">
Cannot show tasks on parent page because this page has no parent.
In Confluence you can write our own user macros (see Writing User Macros). You can wrap the excerpt macro with your own user macro that gets the name of the master page (parent) and puts it into the excerpt macro.
For how to get the parent of a page using Velocity code you'll have to google around (I've never done this).
I gave it a quick try and came across something like
$content.getParent().getTitle(). Did not try it, though.
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 ...
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