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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

97 views 1 0
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