Rendering an included Confluence page several times with different parameters

Joseph 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
Joseph 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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,776 views 26 10
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