Can I use part of a table in and Excerpt and can I create a table from multiple Excerpt-Includes?

I want to use the data part of a table while leaving out the header row so that I can add several excerpts to form a bigger table. Help, ideas, comments??

5 answers

0 votes
Bill Bailey Community Champion Jan 27, 2016

I know of no way to do this. You would need a macro that sits inside the source – and no way I know to do that. So I would say impossible.

You sound like you're trying to perform magic, like me haha. I am trying to perform something very similar to this.

First question, do you have multiple excerpts on the same page? If so, you will need to either use the multi-excerpt addon or get hands dirty with user macros. (All this does is remove the heavy lifting, you will still need a user macro to create the bigger table you want but you can probably do in jQuery in a couple lines to be honest, assuming they have the same columns).

If it is a single excerpt on a multiple pages then you can pull them in using an excerpt-include and then jQuery/javascript your table from the results.
If it is multiple excerpts on a page then maybe forget about the excerpt macro and make a macro to add classes or ID's to your excerpt information (something like:

## Body processing: Rendered
## @param class:title=Class|type=string|required=true|desc=The class(es) you want to add

What I am currently using to add classes to confluence tables).

Then on your table page, pull the information from the pages and display how you want.
My only issue with this method is that, hypothetically, if you have 1000's of pages, how long would it take to pull and parse all the information? My alternative that I am exploring now is to instead update the table page from the excerpt page whenever they are loaded rather than trying to pull all the data.

This method would, onLoad, check if the excerpt is on the table page, if it is update values otherwise create new row. Currently, I am trying to figure out how to POST to a page without having to put user credentials in the user macro.

If you find any charms, incantations or pixie dust to help with this, I'd appreciate you throwing some my way.

Have you found a solution? Ideally, it should be like choosing which pages to print from a document (e.g., 1, 3-5, or all). 

Hi Vivek,

I had a table that served as a 'Summary' of a process on many pages.  I took this table and created a single table that provided an overview of all processes in confluence based on this table.

This was a single table on a process page:

Last Review Date: 01-01-2016
Process Owner: Me
Process Support: You
Critical: Yes
Stakeholder: Some External Dude

That was transformed into the below on my Summary table:

Process Name | Critical | Owner | Support | Stakeholder | Review Date
Process X | Yes | Me | You | Some External Dude | 01-01-2016
--- more rows

It was a PITA to do tbh because I had to learn various bits and pieces to pull it off but it was effectively:

  1. Create process overview page with a single empty table
  2. Create a user-macro for the 'Summary' table that will:
    1. Take user input for various fields
    2. Pull the table from the 'Process Overview' using AJAX, check the values for changes using jQuery, update or insert into html if not already in table
    3. Push this new table back onto the 'Process Overview' page

I also need to make a method to update the 'Process Overview' page from a click rather than having to load each process page individually.

But this meant that any changes were instantly updated on the page and did not require a huge amount of overhead to perform this.

Hope that's helpful.


Thanks for the detailed answer. TBH, it seems like way more work than benefit and I'm also not confident abt my Ajax coding ability. Thanks again. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

258 views 2 10
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