I have a macro I'm writing that would be improved by a conditional that will execute code based on whether a page has children. Does anybody know how to do this?
If you have a page object you can call:
#if($page.hasChildren()) ## do some magic #end
See the page API documentation for more information.
Hope this helps
I see that you can use .hasChildren but $page.hasChildren() did nothing. After some poking around, I found that $content.hasChildren() works just fine.
Thanks Remo!
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.