I am mirroring pages from one space to another via the "include content" element. The original page has lots of headings and a table of contents with an overview of all contained headings.
Now on the mirrored page, clicking one of the links in the table of contents does not let you jump to the respective heading. It does change the https address visibly, but does not jump the heading like clicking it on the original page does.
It also doesnt take you to the original page.
Is this a known limitation or a bug?
Looking forward to insights on this issue!
@Jonas Ast Marc is right that a table of contents sitting on the mirrored page cannot pull headings out of Include content, and when I try it the macro lists nothing from the included page. That is what CONFCLOUD-72449 covers. Yours is a different case, because your entries are there to click, which puts the table of contents inside the include rather than on the mirror.
On your actual question, Atlassian has answered it on CONFCLOUD-72469. Tiffany, a Confluence PM, wrote there that "We designed the Table of Contents macro to only work within the page, blog or macro it has been inserted. It cannot reference or be referenced across multiple pages or blogs", that "Those heading links won't navigate to the source page", and that they updated the documentation to say so. So the part where it refuses to take you back to the original is a limitation. People in that thread argue with her about it and it is still Gathering Interest on 245 votes.
The dead links on the mirror are a separate thing, and there is something that held up when I tried it. On the mirrored page, wrap the Include content macro in a Table of Content Zone macro. The zone builds its list from the page it sits on, so the entries and the headings are generated together and the anchors line up. Twelve headings pulled in from another space, every entry pointed at an id that was there, and the last one scrolled about fourteen thousand pixels down to it. My source page carried no table of contents of its own, so if yours keeps one you will see two lists until you decide which to keep.
Your plain setup I could not break, on pages I made this week in the current editor, so it may come down to how the source page was authored. If it came over from Data Center or was written in the legacy editor, that is where I would look, because the two write heading ids in different formats and a mismatch gives you exactly what you describe, an address that changes and a page that stays put.
https://support.atlassian.com/confluence-cloud/docs/insert-the-table-of-contents-macro/
Thank you for your answer and detailed explanation!
I tried what you suggested, putting another table of contents on the page that has the include content macro and that does produce, like you suggested, a functioning table of contents.
My follow-up question on this is, if there is an alternative to the include content macro to only mirror selected parts of a page. In this case for example to exclude the original table of contents from being mirrored.
I'd be greatful for any further insights on this matter!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, and it is Atlassian's own answer on the macro you are already using. The Include content doc says "If you want to include part of an item rather than the whole item, use the excerpt and insert excerpt macros."
On the source page leave the table of contents where it is and wrap only the part you want mirrored in an Excerpt macro, then fill in its Excerpt name field. Name it even if you only ever have one, because unnamed, "you will only be able to include the content from the first excerpt macro on a page or doc", which is what makes people think the old one-per-page limit is still there. On the mirrored page, inside the Table of Content Zone you already have, replace the include with the Insert excerpt macro, /insertexcerpt, point it at the source page and pick that name. The table of contents sits outside the excerpt, so it never travels. Tick Remove title + frame while you are in there, or the excerpt turns up in a titled box you did not have before.
I ran the swap on a test site first, because the table of contents you just got working was the thing at risk. Mirroring across spaces the way you do, Table of Content Zone over an inserted excerpt gave six entries and all six landed on their heading. The same host page on Include content gave twelve links, the zone's six plus the six in the mirrored table of contents, and it was that second six that was dead in the way you described at the start. Cloud, current editor, one excerpt, on pages I built for the test.
The cost is that this edits the source page, which the include never does, so you need edit rights there and the owners have to be happy with a macro wrapped round their content. You will also see Atlassian pushing synced blocks at the top of those doc pages. I have not tested whether a Table of Content Zone picks up headings inside one, so I am not sending you at it while you have something working.
CONFCLOUD-72449 is the one to watch. Chris from the Confluence team posted there on 22 July that they are starting work on it, no date given, so the zone wrapper may not need to be permanent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the insight into the excerpt and insert excerpt macros. I understand that part clearly and got it working on my end as well.
What is a tad bit unfortunate for my use case that I have to wrap the insertexcerpt with the TOC_zone. In my case, on the original page, I have 4 topics with a heading each and according sub-headings. I ordered those 4 main topics horizontally (in a table) with sub-headings following vertically below (in each coloumn).
I currently have no idea how to retain this way of formatting the TOC while using the TOC_zone and insertexcerpt macros as the TOC_zone would create a long vertical list instead of a coloumn for each lvl 1 heading.
Nonetheless, thank you for your detailed explanations and support!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Layouts instead of tables, and one named excerpt per topic. Your excerpt side stays, it splits into four, an Excerpt macro round each topic on the source with its own Excerpt name, and the single one you have now goes. On the mirror, drop a Table of Content Zone into each column of a four column layout with that topic's Insert excerpt inside it. A zone indexes only what sits in its own body, so each column lists its own topic and the column per lvl 1 heading comes back. /layout puts a layout in, and the column count is a setting on it once it is there.
Table cells will not hold either macro. I built your version first and opened it in the editor, and all four cells read "This is legacy content and has limited functionality" with a Make edits button where the macro should be. Published, the page renders fine, so you only find out when you go to edit it. The same two macros in layout columns come up as four real Table of Content Zone blocks you can click into.
Twelve entries across four columns on my test, every anchor resolved, source in one space and the mirror in another. One zone round all four includes put me straight back on your vertical list of twelve. If you ever restyle a zone, restyle all four the same way, CONFCLOUD-84192 has zones with different settings landing on the same generated CSS class at render time and lists no workaround.
Skip the flat display setting. Both macros carry one and it does put headings horizontally, but on a single line at one level, so your sub-headings would sit beside the topic headings rather than under them. No column parameter exists on either macro. I read both lists.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I thought of that too but the issue is that all content in each excerpt is also squished into the layouts coloumn.
I need just the headings to be in a layouts coloumn, whereas all actual content is listed below in full size. And I don't think that will be possible unless getting the headings from the insertexcerpt actually works using the normal TOC, instead of the TOC_zone. But atleast on my side I cannot get the normal TOC to collect the headings from the inserexcerpt macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can have it, though not out of either table of contents macro. The zone only ever lists what is physically inside its own body, so one per column drags that topic's content into the column with it. That's the squish you hit, and no setting moves the list out of the block it indexes.
So the columns go in by hand. Keep the full-width zone round your Insert excerpts and set its Include Headings to something none of your headings match, which stops it printing a list of its own. The headings still get ids on the mirror page from being inside it. Above it goes a four column layout holding a plain list of links, one column per topic. I put it together on a scratch page and read it back. Each column carried its topic and the two sub-headings under it, the excerpts sat underneath at full page width, and every link had a real id on the other end.
Don't type the ids in. Hover to the right of a heading until the link icon appears and select it, that copies the heading's link. The id has the mirror page's own title on the front of it, so renaming that page kills every link at once. Editing a heading kills its own. Both fail quietly.
On the normal macro, what you get is what I get. CONFCLOUD-72385 is your setup step for step, excerpt include on a page, TOC macro on the same page, no headings listed, and Karl from the Confluence team closed it Won't Fix in 2021 with the reason, "ADF does not indicate whether or not the text in a given macro is of a certain header." They refused it as a bug, and the suggestion that replaced it is the one you already have your eye on.
The one I could not settle is the one that would save you the maintenance. Mine had the excerpts inside a zone, same as yours, so I cannot tell you whether the zone is part of why the plain one comes up empty. Take the zone off a copy of the page and drop a plain table of contents on it. If it lists them, four of those with an Include Headings filter each is your layout with nothing to maintain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jonas Ast
Welcome to the community.
Confluence does not support pulling headings from an Include Page or Excerpt macro into a Table of Contents (TOC) macro. This is a limitation in Confluence Cloud due to server-side rendering updates, meaning macros cannot dynamically scan and index header elements nested inside other included files
See open feature request CONFCLOUD-72449
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.