[All Adaptavist Apps]

Page tree

(warning) Under Consruction

Description

The sorted-children macro can used for displaying lists of child pages...

Usage

{sorted-children}

Parameters

the "Ver" column shows which version of Theme Builder the parameter became available in.

Property

Required

Default

Notes

Theme Panels Only

Ver

default

(error)

@current

The page whose children should be shown
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

 

 

showRoot

(error)

false

Whether to show the root page or not

 

 

showSpaceSiblings

(error)

true

when displaying the path from @dashboard, list the space's siblings

 

 

showPageSiblings

(error)

true

when displaying the path from @dashboard, @parent, @parentparent, @space, @orphan, @root or @home, list the parent page's siblings

 

 

filter

(error)

all

only show spaces of type global/personal/all

 

 

depth

(error)

1

the depth of children to be shown

 

 

countParentPages

(error)

false

include the parent pages in the depth count

 

 

countParentSpaces

(error)

false

include the parent spaces in the depth count

 

 

class

(error)

None

the css classname to apply to the list

 

 

Examples

To follow

Basic Use

CSS Customisation

To follow

Hints and Tips

None at present.

Frequently Asked Questions

None at present.

  • No labels

12 Comments

  1. Unknown User (jbrown@interthinx.com)

    I am using this to display all of the top level pages in my space. Is it possible to have the "Home" page always be at the top of the list? Is it also possible to have it automatically leave out the "Home" page?

    1. Unknown User (amoran)

      {sorted-children:@home} or {sorted-children:@home|showRoot=true}

      1. Unknown User (jbrown@interthinx.com)

        Right now, my pages are structured in my space like this:

        SPACE

        • Home
        • Documents
        • Other Stuff
        • ETC

        So when I have the tag with the parameters you suggest, I get nothing since nothing is under @home. And when I use @root, everything works fine except the list is output alphabetically, and Home ends up in the middle. So I want to either have it be at the top of the list, or not show up at all.

        Should I be structuring my wiki so that everything is under home? I am a little new to Confluence.

        1. Unknown User (amoran)

          Go into browse-space (tree view) and drag the home page to the top of the list.

  2. Unknown User (cherrycoughsyrup@gmail.com)

    I was wondering if there was a way to apply the menubar macro to the sorted-children macro?

    I've tried the following:

    {menubar:id=testchildrenmenu}
    {sorted-children}
    {menubar}
    

    But it doesn't seem to be working. What am I doing incorrectly?

    Thanks in advance for your help!

    1. Unknown User (amoran)

      You need to use the {wikimenu} macro to strip the outer unordered list, which should enable you to use the output of the sorted-children macro in a menu, eg:

      {menubar:id=testchildrenmenu}
      {wikimenu}{sorted-children}{wikimenu}
      {menubar}
      

      Which results in: (I actually pointed this at @root to give it something useful to display)

      Unknown macro: {menubar}
      Unknown macro: {wikimenu} Unable to render content due to system error: java.lang.ClassCastException: class com.adaptavist.confluence.pagemacros.SortedChildrenMacro cannot be cast to class com.atlassian.renderer.v2.macro.Macro (com.adaptavist.confluence.pagemacros.SortedChildrenMacro is in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @7579e8cc; com.atlassian.renderer.v2.macro.Macro is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @d1f74b8)
  3. Unknown User (smcroberts)

    Thanks for this handy macro. The Confluence Notation Guide mentions a sort option. What sort methods are available?

  4. Unknown User (susan.hallwood@nerdsonsite.com)

    How do I get the siblings for every parent page to show in in the menu when not viewing the home page?

    {menubar}
    {menuitem}{menulink:home}Home Page{menulink}{menuitem}
    {wikimenu}{sorted-children:@home|parent=Home|page=@home|showPageSiblings=true|depth=999}{wikimenu}
    {menubar}
    
  5. Unknown User (susan.hallwood@nerdsonsite.com)

    i have found another issue with the menu of space pages that I am tryng to crete. It is not wrapping which does not look pretty. I need to be able to create a menu of all of the pages in a space, wrapp the menu, and I need the menu to work even if the Home page name has been changed. Is there any way to create this menu with the current macros or is it possible to get some one to develop this capability and how much would it cost?

    1. Unknown User (amoran)

      I'm not entirely sure what you are asking for, it's possible that a support contract is what you need rather than actual development since the sorted-children macro should be fine with spaces using non-standard homepage names ... although that depends greatly on what markup you are using - the support contract would enable us to assist you in choosing the correct markup for your task.

      1. Unknown User (susan.hallwood@nerdsonsite.com)

        Perhaps a developer in not in need. I am frustrated since I have been trying to solve this issue for a quite a while now. I started out using the pop-menu macro with the children macro to create a menus of the pages in each space. The children macro didn't work because the client's users have changed the name of some of their home pages. I also discovered that the popmenu macro is part of the popkong theme that is no longer being developed. The popkong theme is installed but when we upgrade the clients production wikis to Confluence 3.5 the popkong theme will be uninstalled and they will be using the new theme that i am creating uing the Builder theme which has to replicate the popkong theme as much as possible. The sorted children macro fixes the problem with the home page name changes but when viewing another page (not the home page) the siblings are only displayed in the a drop down menu for that page. Additionally, when viewing the menu in another space with long page names, the menu overlaps the navagation panel. This would be ok except the theme is a fixed width theme so the menu needs to wrap. I am working on trying wrap the menu using css but that does not fix the issuue with the siblings being displayed in the menu no matter what page you are viewing.

        This is the wiki mark up i have tried:

        {table:width=100%|cellpadding=0|cellspacing=0|border=1|bgcolor=#778899}
        {tr:bgcolor=#778899}
        {td:style=white-space:prewrap}
        {menubar:class=pagemenu}
        {wikimenu}{children:page=Home|all=true|sort=title} {wikimenu}
        {menubar}
        {td}
        {tr}
        {table}
        
        
        {table:width=100%|cellpadding=0|cellspacing=0|border=1|bgcolor=#778899}
        {tr:bgcolor=#778899}
        {td:style=white-space:prewrap}
        {menubar:class=pagemenu}
        {wikimenu}
        {sorted-children:@home|parent=Home|page=Home|countParentPages=true|showPageSiblings=true|depth=999}
        {wikimenu}
        {menubar}
        {td}
        {tr}
        {table}
        
        
        
  6. Unknown User (susan.hallwood@nerdsonsite.com)

    Thanks Alain , i have sent a support request regarding this issue.