Rendering an included Confluence page several times with different parameters

Joe Clark Atlassian Team Oct 22, 2012

I'm developing a dashboard on a Confluence page to display some contribution statistics for individual users.

Using the SQL macro and the Chart macro, I've built some nicely formatted charts and tables to display information for a single user. I want to re-use this content multiple times to display the output for several users on a single page. I thought a good way to do this would be to save the individual user report as one page, and then create another page which can then include the individual report page multiple times - specifying a different username each time it gets included. That way, I'm not endlessly copying and pasting the same wiki markup into several different places and having to update it multiple places each time I want to tweak it.

I seem to have backed myself into a corner now, because I can't quite figure out the correct combination of include macro/run macro/groovy macro to set the parameters for the run macro from another page. The only way I can see to alter the parameters of a run macro from outside the page context is to specify URL query parameters, but I don't think that would be appropriate in this situation?

(Doing this on Atlassian's intranet - we have most of Bob's plugins installed, but none of the more formal 'reporting' plugins like scaffolding).

What's the best way to achieve this "Write Once, Render Many" goal where I define the wiki markup once and then include it in multiple places with different parameters?

1 answer

1 accepted

Hey, this is a switch, me answering one of your questions!!! A key part of your question is: display the output for several users on a single page, otherwise the standard techniques work. Its late here, so best I can do is give you some ideas.

  1. Run macro supports exporting the content created to an attachment
  2. Similarly, chart macro can create png attachments
  3. You can script the rendering of the run macro to produce multiple attachments, one for each user
  4. How to archive pages with dynamic content has techniques that bring multiple pieces of content together on a single page using the HTML Plugin for Confluence
Joe Clark Atlassian Team Oct 28, 2012

Thanks, bob! That got me most of the way there.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

800 views 23 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you