You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi I get one Question pretty frequently from clients and so far I had no answer to them.
Is it possible to show a pages parent on a certain page, like in a page property using Scriptrunner with the "CQL Search" Makro.
These clients typically want all fields filled on a certain page in case they print the page and it should include all context. Or have a large page properties list where they can list for everything.
Are you guys aware of and CQL Query that lists the pages parent page or even the one above.
I've been through this page, tried many things and found no solution for it. https://developer.atlassian.com/server/confluence/advanced-searching-using-cql/
Just the standard list all child pages of a certain page.
I'm sure there must be a way to display that the other way round.
*edit
I think i need to elaborate more with a concrete example
Let me explain using this image of a page tree:
I'm on Page "Dokumentenebene". I would like to display the name of its parent on the Page.
Level: "Zwischenebene A"
And Ideally even one level above that (The parents parent). So that I can have a nice Table saying
Family: "Process family A"
Level: "Zwischenebene A".
Hope that makes sense.
Hi @Antal Vig ,
there's a user macro for a clickable link to the parent page:
##
@noparams
#if
(!$content.getParent()) <b>No parent page found</b>
#else
#contentLink2($content.getParent()
false
false
)
#end
Someone with more coding skills than me could modify this macro to get the parent's parent page ...
Kind regards,
Nicolai
Hi @Antal Vig
When you place the page tree macro it lists down the pages at the root level in space. (It also has expand option to see the child pages)
Other than that with API, you can get the list of pages at the root level in your space
This will surely list the pages at the root level
Let me know if you have any queries
Thanks,
Pramodh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Pramodh M
I actually need it the other way round.
Let me explain using this image of a page tree:
I'm on Page "Dokumentenebene". I would like to display the name of its parent on the Page.
Level: "Zwischenebene A"
And Ideally even one level above that (The parents parent). So that I can have a nice Table saying
Family: "Processfamily A"
Level: "Zwischenebene A".
Hope that makes sense.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dirk Spannaus We tried that usermakro above for that but at the end we didn't used it as the client didn't needed that much as they originally thought :D
## @noparams
#if ($content.getType() == "page")
#foreach ($ancestorPage in $content.getAncestors())
$ancestorPage.getTitle()
#end
#end
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I found out in between, that we can't use user macros in the cloud version 😤
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.