Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-39958

Conf Cloud Anchors made by Table of Contents macro don't work

      NOTE: This bug report is for Confluence Cloud. Using Confluence Server? See the corresponding bug report.

      Summary

      This problem deals with creating new anchors in Confluence Cloud. When anchors are created using the Table of Contents Macro in Confluence Cloud, it has been observed that some links update the URL in the browser navigator but do not navigate to those links.

      Steps to Reproduce

      Environment:
      • Google Chrome Version 46.0.2490.86 (64-bit)
      • Firefox 42.0
      • Safari Version 9.0 (10601.1.56.2)
      1. Using Document Theme
      2. Create anchors in Confluence using the Table of Contents Macro
      3. Select any of the links

      Expected Results

      It should navigate to the expected link.

      Actual Results

      The links do not work.

      Notes

      Nothing is thrown in the logs or the browser console.
      Only affects Document Theme. Global Look and Feel doesn't have this problem.

      Workaround

      Atlassian Status as of 25 Nov 2015

      As covered in: This Comment Below
      Dear All,

      Thanks for taking the time to raise and comment on this issue. Unfortunately the Documentation Theme will be discontinued in Confluence v6.0. So we have decided to close this as won't fix
      More information could be found at: https://confluence.atlassian.com/display/Cloud/2015/07/13/Announcement%3A+Some+Confluence+features+are+going+away

      Regards
      Minh Tran
      Confluence Bugmaster
      Atlassian

      After you click on the anchored link, the URL in the browser will update but nothing will happen. Click on the URL in the browser navigator and click Enter. That will take you to the desired page.

      OR

      Windows - Right Click, or MAC Control+Click, on the link and select open in new tab

      OR

      Update theme to Global Look and Feel

      OR

      Use of Table of Content Zone Macro instead of Table of Contents Macro.

            [CONFCLOUD-39958] Conf Cloud Anchors made by Table of Contents macro don't work

            Ethan McDonald added a comment - - edited

            I wrote and added a simple JQuery script to the Custom HTML header of my Confluence Site

            This works around this issue in all browsers by adding a space before hash symbol in the anchor tag's href attributes that are part of the 'toc-link' css class.
            Example Before: <a href="#sectionid" class="toc-link">
            Example After: <a href=" #sectionid" class="toc-link">

            BTW, needed the SetTimeout to delay things a bit for Firefox.

            <script language="javascript" type="text/javascript">
            //--- Fix Table of Content Hashtag links Jquery----
            //--- Adding space to the beginning HREF for all in the toc-link class---
            $( document ).ready(function() {
            setTimeout(function() {
            $('.toc-link').each(function()

            { var value = $(this).attr('href'); $(this).attr('href', value.replace('#',' #')); }

            );
            }, 200);
            });
            </script>

            Ethan McDonald added a comment - - edited I wrote and added a simple JQuery script to the Custom HTML header of my Confluence Site This works around this issue in all browsers by adding a space before hash symbol in the anchor tag's href attributes that are part of the 'toc-link' css class. Example Before: <a href="#sectionid" class="toc-link"> Example After: <a href=" #sectionid" class="toc-link"> BTW, needed the SetTimeout to delay things a bit for Firefox. <script language="javascript" type="text/javascript"> //--- Fix Table of Content Hashtag links Jquery---- //--- Adding space to the beginning HREF for all in the toc-link class--- $( document ).ready(function() { setTimeout(function() { $('.toc-link').each(function() { var value = $(this).attr('href'); $(this).attr('href', value.replace('#',' #')); } ); }, 200); }); </script>

            @Helen that's a shame but thanks for pointing it out... I've added a note to my comment to avoid giving others false hope.

            Simon Freytag added a comment - @Helen that's a shame but thanks for pointing it out... I've added a note to my comment to avoid giving others false hope.

            @Simon - thanks for sharing but we used Confluence Cloud so no custom HTML for us!

            Helen Griffith added a comment - @Simon - thanks for sharing but we used Confluence Cloud so no custom HTML for us!

            Simon Freytag added a comment - - edited

            Just run into this issue as well. I have applied this HTML as a fix, in the Custom HTML 'end of Body' section:

            <script type="text/javascript">
            // Make the hash links work in the toc macro.
            // Workaround for this bug: https://jira.atlassian.com/browse/CONF-39960
            // Place this in the Custom HTML. It has to be in the 'end of Body', not the
            // head, so that the toc links are loaded.
            AJS.toInit(function() {
            AJS.$('.toc-link').click(function() {
            var hash = AJS.$(this).attr("href");
            var target = AJS.$(hash);
            if (target.length > 0)

            { AJS.$("#splitter-content").scrollTop(target.position().top) }

            });
            });
            </script>

            Formatted version -> more readable: http://www.freytag.org.uk/snippets/conf-toc.html

            Helen has pointed out below that this won't work on Confluence Cloud, because you cannot add Custom HTML.

            Simon Freytag added a comment - - edited Just run into this issue as well. I have applied this HTML as a fix, in the Custom HTML 'end of Body' section: <script type="text/javascript"> // Make the hash links work in the toc macro. // Workaround for this bug: https://jira.atlassian.com/browse/CONF-39960 // Place this in the Custom HTML. It has to be in the 'end of Body', not the // head, so that the toc links are loaded. AJS.toInit(function() { AJS.$('.toc-link').click(function() { var hash = AJS.$(this).attr("href"); var target = AJS.$(hash); if (target.length > 0) { AJS.$("#splitter-content").scrollTop(target.position().top) } }); }); </script> Formatted version -> more readable: http://www.freytag.org.uk/snippets/conf-toc.html Helen has pointed out below that this won't work on Confluence Cloud, because you cannot add Custom HTML.

            @Joshua... The problem (for me) is that the global theme does not provide the features that I need... The navigation looks horrible in the global theme and contains features that I really DON'T want—I cannot switch these features off. So I will complain about it until someone at Confluence fixes the global theme... At this point I will switch to the global theme. If they take away the documentation theme before fixing the global theme, I will continue to complain.

            Helen Griffith added a comment - @Joshua... The problem (for me) is that the global theme does not provide the features that I need... The navigation looks horrible in the global theme and contains features that I really DON'T want—I cannot switch these features off. So I will complain about it until someone at Confluence fixes the global theme... At this point I will switch to the global theme. If they take away the documentation theme before fixing the global theme, I will continue to complain.

            @Jeffrey / @Paul / @Ross

            @Micaela's suggestion worked perfectly for me and nothing changed (not my directory tree, not my TOC) once applied correctly:

            "@Joshua,

            For my scenario, I had one of my site's spaces set to use the Documentation Theme. This is where I was seeing the issue with the TOC links not working after the last Cloud update. Once I changed the theme to the Global theme, the TOC links started working.

            To view Space specific theme follow these steps:
            As an admin, click Spaces > Space Directory > Select Space details icon for one of your spaces > Look and Feel tab

            You will have the option to set the theme to Global or Documentation.

            Hope that helps."

            Joshua Begleiter added a comment - @Jeffrey / @Paul / @Ross @Micaela's suggestion worked perfectly for me and nothing changed (not my directory tree, not my TOC) once applied correctly: "@Joshua, For my scenario, I had one of my site's spaces set to use the Documentation Theme. This is where I was seeing the issue with the TOC links not working after the last Cloud update. Once I changed the theme to the Global theme, the TOC links started working. To view Space specific theme follow these steps: As an admin, click Spaces > Space Directory > Select Space details icon for one of your spaces > Look and Feel tab You will have the option to set the theme to Global or Documentation. Hope that helps."

            It's pretty ridiculous that THIS doesn't work.
            Now I have to sit and spend hours trying to figure out how to list the headings in the macro.
            Everything I've tried doesn't work.

            Jeff Seltzer added a comment - It's pretty ridiculous that THIS doesn't work. Now I have to sit and spend hours trying to figure out how to list the headings in the macro. Everything I've tried doesn't work.

            Helen Griffith added a comment - - edited

            Table of content zone only works if you list the headings:

            • Heading 1
            • Heading 2
            • Heading 3

            If you want to display them flat:
            A | B | C | D | etc....
            the links don't work...

            Helen Griffith added a comment - - edited Table of content zone only works if you list the headings: Heading 1 Heading 2 Heading 3 If you want to display them flat: A | B | C | D | etc.... the links don't work...

            True. Very disappointing. I'm starting to question whether this tool is ready for prime time anymore.
            Simple stuff like this shouldn't be a problem you won't fix.

            Jeff Seltzer added a comment - True. Very disappointing. I'm starting to question whether this tool is ready for prime time anymore. Simple stuff like this shouldn't be a problem you won't fix.

            Very disappointing resolution.

            Paul Yurkov added a comment - Very disappointing resolution.

            One workaround that has worked for me is using the Table of Contents Zone macro instead of the regular Table of Contents Macro. Just paste everything below the ToC into that macro and it works.

            Ross Lindell [Information Officer Pte Ltd] added a comment - One workaround that has worked for me is using the Table of Contents Zone macro instead of the regular Table of Contents Macro. Just paste everything below the ToC into that macro and it works.

            @Joshua - thank you that resolved my issue.

            tara lynne collier added a comment - @Joshua - thank you that resolved my issue.

            Hey all, I found that the spaces themselves were not updated to the correct theme. Once I specified these to global (default) the TOC started working again.

            Joshua Begleiter added a comment - Hey all, I found that the spaces themselves were not updated to the correct theme. Once I specified these to global (default) the TOC started working again.

            @Joshua, I am experiencing the same issue - my theme is Default and yet my TOC links are not working. Did you find a resolution?

            tara lynne collier added a comment - @Joshua, I am experiencing the same issue - my theme is Default and yet my TOC links are not working. Did you find a resolution?

            Kyle Carter added a comment - - edited

            I was pretty unhappy also with the response... I was very grumpy in my emails and signed up for IT Glue... Bye bye confluence

            I was especially unhappy when one of the company core values is "Don't #@!% the customer"

            And they arent fixing something that is currently supported as its not going to be supported in the next version... erm... This is the current version where it IS supported.

            Kyle Carter added a comment - - edited I was pretty unhappy also with the response... I was very grumpy in my emails and signed up for IT Glue... Bye bye confluence I was especially unhappy when one of the company core values is "Don't #@!% the customer" And they arent fixing something that is currently supported as its not going to be supported in the next version... erm... This is the current version where it IS supported.

            Thanks Damien, but the global theme looks DREADFUL. I've listed some of my problems with it in https://jira.atlassian.com/browse/CONF-38256 (18th November). Until those issues are fixed, I'm going to be pretty unhappy about this change.

            Helen Griffith added a comment - Thanks Damien, but the global theme looks DREADFUL. I've listed some of my problems with it in https://jira.atlassian.com/browse/CONF-38256 (18th November). Until those issues are fixed, I'm going to be pretty unhappy about this change.

            Damien (darwyn) added a comment - - edited

            switch your space to Global Theme and everything works...

            Unfortunately the Documentation is discontinued in the next version 5.9. So we have decided to close this as won't fix

            Damien (darwyn) added a comment - - edited switch your space to Global Theme and everything works... Unfortunately the Documentation is discontinued in the next version 5.9. So we have decided to close this as won't fix

            Table of content zone doesn't work for me. Exactly the same problem...

            Helen Griffith added a comment - Table of content zone doesn't work for me. Exactly the same problem...

            @Joshua,

            For my scenario, I had one of my site's spaces set to use the Documentation Theme. This is where I was seeing the issue with the TOC links not working after the last Cloud update. Once I changed the theme to the Global theme, the TOC links started working.

            To view Space specific theme follow these steps:
            As an admin, click Spaces > Space Directory > Select Space details icon for one of your spaces > Look and Feel tab
            You will have the option to set the theme to Global or Documentation.

            Hope that helps.

            Michela Baca added a comment - @Joshua, For my scenario, I had one of my site's spaces set to use the Documentation Theme. This is where I was seeing the issue with the TOC links not working after the last Cloud update. Once I changed the theme to the Global theme, the TOC links started working. To view Space specific theme follow these steps: As an admin, click Spaces > Space Directory > Select Space details icon for one of your spaces > Look and Feel tab You will have the option to set the theme to Global or Documentation. Hope that helps.

            @Michela,

            According to the themes section I'm using the default theme (though it looks very much like the documentation theme), and I can't switch (there's no find more themes link...)

            Joshua Begleiter added a comment - @Michela, According to the themes section I'm using the default theme (though it looks very much like the documentation theme), and I can't switch (there's no find more themes link...)

            It looks like the Documentation Theme is being retired, not the Table of contents Macro. I have changed my Space theme to the global theme from the documentation theme and that fixed the issue, Table of contents links (nested panels) not working.

            I hope this little tidbit helps.

            Michela Baca added a comment - It looks like the Documentation Theme is being retired, not the Table of contents Macro. I have changed my Space theme to the global theme from the documentation theme and that fixed the issue, Table of contents links (nested panels) not working. I hope this little tidbit helps.

            +1 to Josh's comment.

            Kyle Peters added a comment - +1 to Josh's comment.

            Hey @Minh Tran [Atlassian Bugmaster]

            I'm confused by your statement. Are you saying that table of contents isn't supported moving forwarded? What's it being replaced with? That's a pretty basic component of using Atlassian wiki so I'd be very, very surprised, if that (and other pieces used for documentation) wasn't being supported moving forward. To be explicit, this is not a component related specifically to the documentation theme, this is the Table of Contents macro that can be found as an insertable item to any Confluence page.

            Cheers,
            Josh

            Joshua Begleiter added a comment - Hey @Minh Tran [Atlassian Bugmaster] I'm confused by your statement. Are you saying that table of contents isn't supported moving forwarded? What's it being replaced with? That's a pretty basic component of using Atlassian wiki so I'd be very, very surprised, if that (and other pieces used for documentation) wasn't being supported moving forward. To be explicit, this is not a component related specifically to the documentation theme, this is the Table of Contents macro that can be found as an insertable item to any Confluence page. Cheers, Josh

            Minh Tran added a comment -

            Dear All,

            Thanks for taking the time to raise and comment on this issue. Unfortunately the Documentation is discontinued in the next version 5.9. So we have decided to close this as won't fix
            More information could be found at: https://confluence.atlassian.com/display/Cloud/2015/07/13/Announcement%3A+Some+Confluence+features+are+going+away

            Regards
            Minh Tran
            Confluence Bugmaster
            Atlassian

            Minh Tran added a comment - Dear All, Thanks for taking the time to raise and comment on this issue. Unfortunately the Documentation is discontinued in the next version 5.9. So we have decided to close this as won't fix More information could be found at: https://confluence.atlassian.com/display/Cloud/2015/07/13/Announcement%3A+Some+Confluence+features+are+going+away Regards Minh Tran Confluence Bugmaster Atlassian

            Also waiting on a fix.

            Kyle Carter added a comment - Also waiting on a fix.

            Ian Kent added a comment -

            This really sucks!!! The toc macro has been working fine for years. Suddenly it is broken as of Monday morning. Looks like a regression on functionality during cloud deployment upgrade This has been happening a lot lately.

            Ian Kent added a comment - This really sucks!!! The toc macro has been working fine for years. Suddenly it is broken as of Monday morning. Looks like a regression on functionality during cloud deployment upgrade This has been happening a lot lately.

            The fastest workaround I know of is to click Refresh in your browser immediately after clicking a TOC link.

            Deleted Account added a comment - The fastest workaround I know of is to click Refresh in your browser immediately after clicking a TOC link.

            I maintain 6 separate on-demand wikis, and this problem appears in 3 of them when accessing on my desktop. The problem does NOT appear when using an iOS mobile device – even when switching to "desktop version" on the mobile device. All 6 wikis use the Documentation theme. Perhaps this helps?

            Deleted Account added a comment - I maintain 6 separate on-demand wikis, and this problem appears in 3 of them when accessing on my desktop. The problem does NOT appear when using an iOS mobile device – even when switching to "desktop version" on the mobile device. All 6 wikis use the Documentation theme. Perhaps this helps?

            lrogowski added a comment -

            Hello Atlassian - what is the ETA for the fix?

            lrogowski added a comment - Hello Atlassian - what is the ETA for the fix?

            We're also experiencing this problem

            Joshua Begleiter added a comment - We're also experiencing this problem

            Piotr Mazij added a comment - - edited

            I agree with Helen. Also, we use Document Theme, as it fits our needs best - we use it in product documentation, for clients who do not need to know the workaround - they just want the page to work well.

            Piotr Mazij added a comment - - edited I agree with Helen. Also, we use Document Theme, as it fits our needs best - we use it in product documentation, for clients who do not need to know the workaround - they just want the page to work well.

            The workaround is crazy... The table of contents is useful to jump straight down to the required section. Opening the link in another tab saves no time at all!

            Helen Griffith added a comment - The workaround is crazy... The table of contents is useful to jump straight down to the required section. Opening the link in another tab saves no time at all!

            WORKAROUND

            I found a workaround. After you click on the anchored link, the URL in the browser will update but nothing will happen. Click on the URL in the browser navigator and click Enter. That will take you to the desired page.

            Eric Franklin (Inactive) added a comment - WORKAROUND I found a workaround. After you click on the anchored link, the URL in the browser will update but nothing will happen. Click on the URL in the browser navigator and click Enter. That will take you to the desired page.

              Unassigned Unassigned
              piotr.mazij1 Piotr Mazij
              Affected customers:
              13 This affects my team
              Watchers:
              27 Start watching this issue

                Created:
                Updated:
                Resolved: