How to present a tables from a few different pages within a new common page?

Case:

I have a 3 pages on Confluence. On every page there is one or more tables which I want to present on the one common page.

I know the Excerpt/Excerpt Include macro, but I am looking for a solution which will automatically adding a newly created tables.

Maybe there is a possibility to tag a tables by a specific tag and then use some macro on the common page which will automatically import a tables which meets the tag?

1 answer

1 accepted

If the three pages contain *only* the table(s), you can use this awesome user macro created by @Davin Studer.

## Developed by: Davin Studer
## Date created: 12/4/2014
 
## @param ShowTitle:title=Show Title|type=boolean|desc=Deselect to remove the title of the child page.|default=true
## @param LinkTitle:title=Link Title|type=boolean|desc=Select to turn the titles of the child pages into links to those pages (Show Title must be selected).|default=false
## @param Order:title=Order|type=enum|enumValues=Nav Order,Reverse Nav order,Alphabetical,Reverse Alphabetical,Create Date,Reverse Create Date|default=nav order|desc=What order should the child pages be displayed? Nav Order refers to the order of the child pages in the nav tree. Reverse Nav Order simply reverses that.
 
#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( $data = "" )
#if( $paramOrder == "Nav Order" || $paramOrder == "Reverse Nav order")
    #set( $children =  $pageManager.getPage($content.id).getSortedChildren() )
#elseif( $paramOrder == "Alphabetical" || $paramOrder == "Reverse Alphabetical")
    #set( $array =  $pageManager.getPage($content.id).getChildren() )
    ###############################################################
    ## Could not find a method to get them in Alphabetical order ##
    ## Must sort them myself ... Bubble sort                     ##
    ###############################################################
    #set( $size = $array.size() )
    #foreach( $junk in $array )
        #set( $count = -1 )
        #foreach( $line in $array )
            #set( $count = $count + 1 )
            #if( $velocityCount < $size )
                #if( $line.getTitle().compareToIgnoreCase($array.get($velocityCount).getTitle()) > 0 )
                    #set( $tmp = $array.get($velocityCount) )
                    #set( $junk = $array.set($velocityCount, $line) )
                    #set( $junk = $array.set($count, $tmp) )
                #end
            #end
        #end
    #end
    #set( $children = $array)
#elseif( $paramOrder == "Create Date" || $paramOrder == "Reverse Create Date")
    #set( $children =  $pageManager.getPage($content.id).getChildren() )
#end
 
#foreach( $child in $children )
    #set( $include = "" )
    #set( $include = $include + '<div class="included-child-page">')
    #if( $paramShowTitle == true )
        #if( $paramLinkTitle == true )
            #set( $include = $include + '<h1 class="included-child-page-title"><a href="' + $child.getUrlPath() + '">' + $child.getTitle() + '</a></h1>' )
        #else
            #set( $include = $include + '<h1 class="included-child-page-title">' + $child.getTitle() + '</h1>')
        #end
    #end
    #set( $include = $include + '<div class="included-child-page-body">')
        #set( $include = $include + '<ac:structured-macro ac:name="include">')
            #set( $include = $include + '<ac:parameter ac:name="">')
                #set( $include = $include + '<ac:link>')
                    #set( $include = $include + '<ri:page ri:content-title="' + $child.getTitle() + '" ri:space-key="' + $content.spaceKey + '"/>')
                #set( $include = $include + '</ac:link>')
            #set( $include = $include + '</ac:parameter>')
        #set( $include = $include + '</ac:structured-macro>')
    #set( $include = $include + '</div>')
    #set( $include = $include + '</div>')
    #if( $paramOrder == "Nav Order"  || $paramOrder == "Alphabetical" || $paramOrder == "Create Date" )
        #set( $data = $data + $include )
    #else
        #set( $data = $include + $data)
    #end
#end
 
$data
 
<style type="text/css">
    .included-child-page {margin-bottom: 30px;}
</style>
Davin Studer Community Champion Jan 14, 2016

Hey! I like that answer. :)

Thanks for help! I will try it smile

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
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

629 views 6 12
Read article

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