Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to aggregate the contents of certain section of a page on one page?

Denis Boisvert January 30, 2014

I am trying to find a way to show the contents of all the pages with a certain section on one confluence page.

Is there a way to do this?

As an example, let's say we enter all our retrocession in confluence, we would like to show all item that we do best in the company in one page as a summary for manager.

1 answer

0 votes
Davin Studer
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.
January 30, 2014

Would the include-excerpt or include page macros fulfill what you are trying to do?

Denis Boisvert January 30, 2014

Hi Davin,

I tried the Excerpt Include Macro. It's a bit what I want but for multiple page. I could do it, but I would have to do it manually for each page.

I would like something more automatic, like show all contents of a space with an excerpt macro.

Maybe there is a plugin that do what I want.

Davin Studer
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.
January 31, 2014

Do you want all the contents of each page, or just part? Would it work for you to apply a label to the pages that you want included on another page? Below is a User Macro to include the contents on pages with a specified label on another page.

Macro Name:
include_by_label

Macro Title:
Include By Label

Template:
##Created by: Davin Studer
##Date: 1/31/2014

## @paramLabel:title=Label|type=string|required=true|desc=Enter a label.

#set( $containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )
#set( $getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null) )
#set( $containerManager=$getInstanceMethod.invoke(null,null) )
#set( $containerContext=$containerManager.containerContext )
#set( $pageManager=$containerContext.getComponent('pageManager') )
#set( $labelManager = $action.LabelManager )

#set( $labRef = $labelManager.getLabel($paramLabel) )
#set( $pages = $labelManager.getCurrentContentForLabelAndSpace( $labRef, $content.spaceKey ) )

#foreach ( $page in $pages )
<div class="included_page_content">
<h2>$page.getTitle()</h2>
$action.getHelper().renderConfluenceMacro("{include:$page.getTitle()}")
</div>
#end

<style>
.included_page_content {margin-bottom: 10px;}
</style>

Denis Boisvert February 2, 2014

A label sound perfect for me. I want just part of all pages. Since we use a template, I could put the label in the template. I will try this tommorow and let you know if it's working.
Thanks!

Davin Studer
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.
February 3, 2014

The above user macro will insert all of the contents of the pages with the label. If you only want part of the page you would tag the page with the label to identify it as a page to pull in and then wrap the content to be pulled in with an excerpt macro. And then add the below user macro to the aggregation page. It is just a modified version of the above user macro, but it uses the excerpt-include fucntionality instead of page include functionality.

Macro Name:
include_excerpt_by_label

Macro Title:
Include Excerpt By Label

Template:
## @paramLabel:title=Label|type=string|required=true|desc=Enter a label.

#set( $containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )
#set( $getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null) )
#set( $containerManager=$getInstanceMethod.invoke(null,null) )
#set( $containerContext=$containerManager.containerContext )
#set( $pageManager=$containerContext.getComponent('pageManager') )
#set( $labelManager = $action.LabelManager )

#set( $labRef = $labelManager.getLabel($paramLabel) )
#set( $pages = $labelManager.getCurrentContentForLabelAndSpace( $labRef, $content.spaceKey ) )

#foreach ( $page in $pages )
<div class="included_page_content">
<h2>$page.getTitle()</h2>
$action.getHelper().renderConfluenceMacro("{excerpt-include:$page.getTitle()|nopanel=true}")
</div>
#end

<style>
.included_page_content {margin-bottom: 10px;}
</style>

Vera Henrichs
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.
December 3, 2015

Do you have a screenshot how this looks (and works with those labels)? Sounds interesting!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events