It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence Macro: Using confluence-content

Alex Church Jul 06, 2011

I'm working on a macro that I would like to print the title, an except from and a link to some article (from any space). It is designed to be used on the Dashboard to highlight articles of interest.

Given the "confluence-content" parameter type I assumed this would be easy, and indeed the widget in the macro creator makes searching for and selection an article very easy. But all this seems to pass through is a string in the format <space>:<page>. I haven't yet been able to find a way to use this string to actually select the appropriate page and use it the way I would like.

Any suggestions?

1 answer

1 accepted

1 vote
Answer accepted
David Simpson Community Leader Jul 07, 2011

The string is in format spaceKey:pageTitle, so you can access the Page object using...

Page page = pageManager.getPage(spaceKey, pageTitle);

Use dependency injection to get the PageManager object

Alex Church Jul 11, 2011

Thanks. I was just using user macros, but have since migrated to using plugins, which provide much more flexibility.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

912 views 0 19
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you