Is there a way to automatically number the items in the 'Children Display Macro'?
It would be really nice to know how many child pages there are.
It would also be really nice to be able to use multi-level number, so one could very quickly and easily reference a specific page, such as:
1. Child page 1
2. Child page 2
2.1 xxx
2.1.1 yyy
3. Child page 3
Hello,
Have you taken a look at the Pagetree Macro? This is an example of the macro being run on my page.
That's a pretty nice macro, but it doesn't seem to provide the auto-numbering feature that I'm looking for.
My main goal with the auto-numbering is to clearly get a quick count and in turn a high-level scope of the work.
For example:
If I can quickly see that there are 12 child pages and I know that each one will take 5 minutes to update (or fix or create or ...), then I will know that it is going to take approximately an hour to do the work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Are you familiar with user macros/do you have access to create them? I found an existing (credit to @Steven F Behnke one online and modified it slightly to get a first pass at what you are looking for. It will look one level deep, and provide a count for all the child pages.
If you need it to look deeper, that could be done, but I'd have to spend some more time on it.
To create this, go to Administration > User Macros > Create new use rmacro.
For the options, I put in the following:
The code itself looks like this:
## Macro title: Children and Parent
## Macro has a body: N
## Body processing: No macro body
##
## Developed by: Steve Behnke, modified by Kian Stack
## Date created: 3/18/2020
## Installed by: Your name here...
##
## This macro creates a unordered list of the current page and descendants.
##
## @noparams
#set($currentPage = $pageManager.getPage($content.getId()))
#set($childPages = $currentPage.getChildren())
<ul>
<li>
<a href="$currentPage.getUrlPath()">$currentPage.getDisplayTitle()</a>
</li>
<ol>
#foreach ($childPage in $childPages)
<li>
<a href="$childPage.getUrlPath()">$childPage.getDisplayTitle()</a>
</li>
#end
</ol>
</ul>
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.