Hi All
Could anyone explain what I am missing with this small user macro:
## @Param Childpage:title=Childpage ID|type=string|required=true
#set($parentpages = $pageManager.getPage($paramChildpage).getParent().getId())
$parentpages
What I try to achieve is to: 1) enter a valid pageID into the parameter "Childpage" and 2) have the user-macro return the parent page.
It works if I skip the parameter and enter a pageID directly into ...getPage(_some_pageID_). But I have no luck getting a result when using $paramChilpage - macro output is: $parentpages
I have found a couple of community-solutions working with <spacekey> and <pagetitle> that go into getPage() - but I need to find parent pages based on pageID only.
Pleased to hear.
/Anders
Found the solution in an other thread... @Davin Studer had the trick:
Convert user macro param (here: $paramuplimit) like below:
$generalUtil.convertToInteger("$paramuplimit")
Thanks for helping me out :-)
Brgds Anders
Possible for you to expound? What did you need to convert to integer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.