How to break the children display macro into two columns?
Asked by Alirezza Motti:

I'm using the children display macro to show a list of pages under a certain page, but the list is too long and I'd like to break it into two columns to make it more readable and make the layout of the page nicer.

Is this possible at all with children display macro? If not, what tool would you recommend?

Cheers!


Answers:
author: Samjad Kollanandy
body: It is possible with CSS and a custom macro. What I did was,

1. Added the following CSS to my space stylesheet:  

   .childpagemulticolumn ul{

   display: flex;

   flex-direction: column;

   flex-wrap: wrap;

   max-height: 300px;

   }

2. You can then create a custom macro :  
   The Macro Body Processing should be 'Rendered'  

   ## @noparams  
   \<div class="childpagemulticolumn"\>$body\</div\>  

3. Now in your page with Children Display macro:   
   Insert this new custom macro and then insert 'Children Display' macro inside this new custom macro.  

PS: I have admin access so I am able to edit space stylesheet and create custom macro.

comments: author: Paul Mata
body: [@Samjad Kollanandy](/t5/user/viewprofilepage/user-id/2634613) I tried implementing your solution, but it seems this no longer works. I have created the custom user macro and edited the space style sheet, both using the code you provided above, but I still get a single column display of the child pages. Any ideas what I might have gotten wrong (or if something has changed)?

![macro.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/126071iB3EF6466F873C7B9/image-dimensions/302x250?v=v2 "macro.PNG")![stylesheet.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/126072i098F93876059182F/image-dimensions/302x288?v=v2 "stylesheet.PNG")![page-edit.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/126073i8E6CD1C63B51FDC8/image-dimensions/410x134?v=v2 "page-edit.PNG")![page-rendered.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/126074iE81DEF1713FD5BBD/image-dimensions/400x302?v=v2 "page-rendered.PNG")


author: Samjad Kollanandy
body: Hi [@Paul Mata](/t5/user/viewprofilepage/user-id/3744231) ,

I see that you have set childrendisplay macro style=h3.

So in the stylesheet remove ul and li, -

```
.childpagemulticolumn {

...

...

}
```


author: Sorana CAPALNEAN
body: hello,

A workaround would be to display the first n/2 children in a first "children macro", then on a second one to have them displayed in a reverse sort.

Macro #1 :

- Number of Children : n/2

- Sort Children By : title

- reverse sort : **false**

Macro #2 :

- Number of Children : n/2

- Sort Children By : title

- reverse sort : **true**

comments: author: Paul Mata
body: \*moved reply under correct comment\*


author: Alex
body: That worked! Thank you!


author: Oscar
body: the Number of Children : n/2 filter doesn't seem to apply...Any pointers?

I should add that the number of children is dynamic on my page so I used n...Maybe you used 'n' as a placeholder for the deterministic value of children on *your* page?


author: Shannon S
body: Hi Alireza,

The native Children Display macro is not able to be displayed in more than one column. This was [requested as a feature](https://jira.atlassian.com/browse/CONFSERVER-22625) in the past but has been rejected.

You could try manually inserting the links to child pages, or see if you download the [Source Editor](https://marketplace.atlassian.com/plugins/com.atlassian.confluence.plugins.editor.confluence-source-editor/server/overview) add-on, you may be able to directly alter the formatting.

Kind Regards,  
Shannon

comments: author: Jeff Nayler
body: Shame, would have been a very useful feature


Tags: child-page

macro