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

Is there an Exception Option for the Children Display Macro?

Jennifer Miller July 27, 2018

When editing the 'Children Display' macro there is not an edit option for excluding child pages I don't want listed based on the rules I set in the options. It would be a helpful addition to the edit options.

Thank you!

4 answers

2 votes
jo llo August 23, 2018

I also would like an exclude option for the children display macro. It is sometimes useful to display all the children of the current page's parent - all its siblings, and maybe its nieces and nephews. You can do that by naming the parent page in the children display macro, but the current page is included in the results, which is ugly.

0 votes
Matteo Gubellini _SoftComply_
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.
February 28, 2021

Hi,

I am by no means a developer, but this piece of code does exactly this. You can modify it to show the links too.

## @param noShowLabel:title=Label|type=string|desc=Label of pages to exclude

#macro(childrenList $parentPage)
#set($childpagesSub = $parentPage.getSortedChildren())
#set($childrenN = $childpagesSub.size())
#if($childrenN > 0)
<ul>
#foreach($page in $childpagesSub)
#set($noShow=0)
#set($pageLabels = $page.getLabels())
#foreach($pageLabel in $pageLabels)
#if($pageLabel == $paramnoShowLabel)
#set($noShow=1)
#end
#end
#if($noShow==0)
<li>$page.getTitle()</li>
#childrenList($page)
#end
#end
</ul>
#end
#end

#childrenList($content)
Paula MENÉNDEZ August 11, 2023

hello! how can i implemen this piece of code on a page? do i need. a macro? thanks

0 votes
Kai Siren July 16, 2019

I also would like an exclude option for the children display macro. It is sometimes useful to display all the children of the current page's parent - all its siblings, and maybe its nieces and nephews. You can do that by naming the parent page in the children display macro, but the current page is included in the results, which is ugly.

This is exactly the same thing I want!

I looked at the two feature request tickets, and the mechanisms and policies for upvoting were confusing. So I'm leaving my +1 here in the meantime.

+1

0 votes
Zak Laughton
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 30, 2018

Hi Jennifer!

Unfortunately, there's not a way to exclude child pages in either the Children Display macro or the Page tree macro. The Content by Label and Search Results macros both return filtered lists of pages, and may work as alternative options (depending on your requirements).

I found a suggestion ticket for the functionality to exclude pages from the Children Display macro here: CONFSERVER-43198. The ticket was closed by Product Management due to lack of activity, but you can still vote and comment on the ticket to give our developers more meaning surrounding the issue to possibly be fixed according to the Implementation of New Features Policy.

Thanks!
-Zak

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events