Rendering an included Confluence page several times with different parameters

Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 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

2 votes
Answer accepted
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 22, 2012

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
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2012

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events