ThemeBuilder for Confluence Server and DC

Sorted Children

The Sorted Children Macro displays a sorted list of child pages.

Usage

Storage Format

<ac:macro ac:name="sorted-children">
<ac:parameter ac:name="parameter">value</ac:parameter>
</ac:macro>

Wiki Markup

{sorted-children:parameter=value}

Parameter

Name

Description

Type

Default

Required

rootpage

Root page

The page or space whose children should be shown (defaults to the current page)

Possible values:

  • SPACEKEY:pagename - a specific page in a specific space

  • pagename - a specific page in the current space

  • @self - the current page

  • @current - same as @self

  • @parent - the parent of the current page

  • @parentparent - the parent of the current page’s parent

  • @orphan - as an orphaned page in the current space

  • @space - same as @orphan

  • @root - the root of the current page’s tree

  • @home - the homepage of currently viewed space

confluence-content

@current

error

filter

Filter

Only display spaces of the given type

enum

sorted

error

class

CSS Class

The css class to add to the wrapper

string

error

depth

Depth

The depth of children to display

string

1

error

showRoot

Show Root

Include the root page in the display

boolean

false

error

showPageSiblings

Show Page Siblings

Show the siblings of the root page - when displaying the path from @dashboard, @parent, @parentparent, @space, @orphan, @root or @home

boolean

false

error

showSpaceSiblings

Show Space Siblings

Show the siblings of the spaces

boolean

false

error

countParentPages

Count Parent Pages

Include parent pages in the depth count

boolean

false

error

countParentSpaces

Count Parent Spaces

Include parent spaces in the depth count

boolean

false

error

flag

Flag

A list of flags, one of which must be defined for the content to be displayed

string

error

notflag

Not Flag

A list of flags which must not be defined for the content to be displayed

string

error

Basic Example

A simple list of all child pages.

<ac:macro ac:name="sorted-children" />
{sorted-children}

Using this will result in the following list:

sorted children list

Advanced Example

A list of child pages with custom CSS to style links and indents. This is suitable for a tree style navigation.

<ac:macro ac:name="sorted-children">
  <ac:parameter ac:name="showRoot">true</ac:parameter>
  <ac:parameter ac:name="rootpage">@home</ac:parameter>
  <ac:parameter ac:name="class">myclass</ac:parameter>
  <ac:parameter ac:name="filter">all</ac:parameter>
  <ac:parameter ac:name="depth">3</ac:parameter>
</ac:macro>
{sorted-children:showRoot=true|rootPage=Adaptavist Documentation Home|class=myclass|filter=all|depth=3}

The following CSS should be added in the ThemeBuilder Custom CSS editor:

/* remove disc, margin and padding on list */
ul.myclass {
    list-style: none;
    margin: 0;
    padding: 0;
}
/* add padding to the list elements for spacing */
.myclass li {
    padding: 2px;
}
/* add padding to the child elements to produce indent */
.myclass li.child {
    padding: 2px 2px 2px 20px;
}
/* make the current page link bold */
.link.current.myclass.actual.page {
    font-weight: bold;
}

Using this markup will result in the following:

advanced example sorted children