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

How can I exclude headers of an excerpt-include from a table of contents

Daniel Schulz March 13, 2018

Hi Community!

I have a problem with the table of contents (toc) in combination with the Excerpt-Include feature.

I cannot exclude headers of an excerpt-include from a toc. 

The structure of my pages is as following.

Structure of page 1:

{
  {excerpt}
    <h1>P1-Header 1</h1>
    <h2>P1-Header 1.1</h2>
    <h2>P1-Header 1.2</h2>
  {/excerpt}
}

Structure of page 2:

{
  {toc}
  <h1>P2-Header 1</h1>
  <h2>P2-Header 1.1</h2>
  {excerpt-include of page 1 /}
  <h2>P2-Header 1.2</h2>
}

Result toc of page 2 now looks like:

* P2-Header 1
** P2-Header 1.1
* P1-Header 1
** P1-Header 1.1
** P1-Header 1.2
** P2-Header 1.2

Now I couldn"t find a way to exclude the headers of the Excerpt-Include (page 1) within the toc of page 2.

The result toc which I try to get is:

* P2-Header 1
** P2-Header 1.1
** P2-Header 1.2

 

Can anyone help me out to find a solution?

We are using Confluence 6.5.1.

2 answers

1 accepted

2 votes
Answer accepted
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.
March 13, 2018

The only way I can think to do this would be to change the headings on your include page to something higher ... like h3 and h4 and then tell you TOC macro to ignore h3 and h4.

Daniel Schulz March 14, 2018

Hi Davin,

 

Thank you for your fast reply.

I was afraid that something like this would be the way. 

Then I will try to do it like your proposal or 'excerpt' multiple parts without the heading tags.

Thank you again!

 

Best regards,

Daniel

Daniel Schulz March 14, 2018

I just tried to use multiple excerpts but it does not work.

It seems not to be a bug because the documentation also says:

"You can only define one excerpt per page. In other words, you can only add the Excerpt macro once to a page."

See https://confluence.atlassian.com/conf65/excerpt-macro-939701208.html 

 

For now I do not use the Excerpt macro anymore. I just linked the parts of the other pages. Maybe they will improve the feature for the future.

Like Anna Hummel likes this
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.
March 14, 2018

There are a couple add-ons in the mareket place that allow for multi excerpt includes.

Multi Excerpt (paid)

Include Content (free)

Daniel Schulz March 15, 2018

Thanks Davin the add-ons helped me out!

1 vote
Ralf July 13, 2021

I still have the same problem. To put the headings to a higher level is no solution for me, it takes to much of the flexibility.

Is it not possible to exclude the ToC numbering for excerpt include?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events