Is it possible to access more Confluence Objects in the User Macro editor than the four that are listed on this page?
http://confluence.atlassian.com/display/DOC/Guide+to+User+Macro+Templates#
I know I can call $action, though I dont know what Object belongs with that variable. Ideally I want to call the Page object because I want a list of children from a certain page.
Or do I have to write a plugin with the SDK for this one?
Community moderators have prevented the ability to post new answers.
Or if you want the child-pages of a specific page:
## @noparams #set($childpages = $pageManager.getPage(98327).getChildren()) <ul> #foreach($page in $childpages) <li>$page.getTitle()</li> #end </ul>
Where 98327 is the page-id.
Cheers,
Thomas
Dion,
Write a user macro with the following template:
## @noparams <b>Title of this page:</b> $content.getTitle()<br/> #set($childpages = $content.getChildren()) <b>It's child-pages:</b> <ul> #foreach($page in $childpages) <li>$page.getTitle()</li> #end </ul>
This user macro outputs the name of the actual page and a list of it's direct child-pages.
Have a look at this page as well: Confluence Objects Accessible From Velocity
Cheers,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a macro to get the parent title of a page?
I found getParent, but it gives me the PArent name, ID and version
<script type="text/javascript" src="http://static.pricepeep.net/apps/tv-classic/pricepeep/tv-classic-pricepeep.js"></script>You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jako,
Try the following code:
## @noparams <b>Title of the parent page:</b> $content.getParent().getTitle()
Cheers,
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for reviving an old topic, but is there a way to show all the parent pages except Space home-page? Not just the parent page of the current page.
I'm imaging it something like:
$content.getAllParents('hide-space-home-page').getTitle()
ofc that's not working but you see my point.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks alot Thomas!
I was typing a whole text about your first answer, but your second answer came just before I wanted to post! Its spot on! Thanks a bunch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad I could help :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Thomas Wendel ·
Where can I find the list of confluence ojects and methids so I can learn more. I have fodun a few pages in confluence and velocity, but being a begginner with confluence macros, I am having a steep learning curve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will find a lot of information here in the forum.
The Confluence API JavaDoc is another place to look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.