Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-3844

Anchor links to the current page break when included in a different page

      Anchors automatically rendered with the page name in front of the anchor, eg #anchor name becomes #page-anchor name. This was done in Confluence 2.0 to fix anchor links in space PDF exports.

      Unfortunately, this has the side effect of breaking anchor links on pages which are included via the

      {include}

      or

      {excerpt-include}

      macro in a different Confluence page.

            [CONFSERVER-3844] Anchor links to the current page break when included in a different page

            In case it helps any of you, the Table of Contents macro has an "Absolute URL" option.  If you check this option, then a TOC included in an excerpt will work properly in an Excerpt Include on a different page. 

             

            See 

            https://community.atlassian.com/t5/Confluence-questions/Display-a-Working-Table-of-Contents-on-a-Different-Page/qaq-p/125911

             

            Jim Heddles added a comment - In case it helps any of you, the Table of Contents macro has an "Absolute URL" option.  If you check this option, then a TOC included in an excerpt will work properly in an Excerpt Include on a different page.    See  https://community.atlassian.com/t5/Confluence-questions/Display-a-Working-Table-of-Contents-on-a-Different-Page/qaq-p/125911  

            Jessica Weissman added a comment - - edited

            I am using Confluence 6.3 and ran into the issue.  I have a page with a page excerpt that is included in a rollup page.  The excerpt includes lots of links to anchors.  Works fine on the original page, dies just as Carla Gray indicates above.

            Because this doesn't work I have to maintain two copies of a set of links.

            June 8th is my last day on the project but the next developer will run into the same problem and have to put forth the same duplicate effort.

             

            Jessica Weissman added a comment - - edited I am using Confluence 6.3 and ran into the issue.  I have a page with a page excerpt that is included in a rollup page.  The excerpt includes lots of links to anchors.  Works fine on the original page, dies just as Carla Gray indicates above. Because this doesn't work I have to maintain two copies of a set of links. June 8th is my last day on the project but the next developer will run into the same problem and have to put forth the same duplicate effort.  

            Issue still present in Confluence 6.9 and 6.3.

            Ann Worley (Inactive) added a comment - Issue still present in Confluence 6.9 and 6.3.

            Carla Gray added a comment -

            I'm using version 5.4.4 of Confluence, and I don't see how this is fixed. The issue discussed in "CONF-15098 excerpt-include doesn't correct links to anchor inside the excerpt" is not resolved.

            We are also using excerpt and excerpt include. On the original page, I insert a link to a specific heading on that page (Insert > Link > Advanced. In the link field, enter "#HeadingTitle"). Then, I use the excerpt include macro, and the link doesn't work. I've tried the following to fix it:

            • Inserted an anchor on original page. This will not work on the include page.
            • Inserted "#HeadingTitle." This will not work on the include page.
            • Inserted "Page Name#HeadingTitle." Confluence automatically strips out the current page name and saves it as just "#HeadingTitle." As a result, this does not work on the include page.

            Carla Gray added a comment - I'm using version 5.4.4 of Confluence, and I don't see how this is fixed. The issue discussed in " CONF-15098 excerpt-include doesn't correct links to anchor inside the excerpt" is not resolved. We are also using excerpt and excerpt include. On the original page, I insert a link to a specific heading on that page (Insert > Link > Advanced. In the link field, enter "#HeadingTitle"). Then, I use the excerpt include macro, and the link doesn't work. I've tried the following to fix it: Inserted an anchor on original page. This will not work on the include page. Inserted "#HeadingTitle." This will not work on the include page. Inserted "Page Name#HeadingTitle." Confluence automatically strips out the current page name and saves it as just "#HeadingTitle." As a result, this does not work on the include page.

            Kendziorra. As you have found, that particular case does not work very well although it is a different issue from this one.

            An issue already exists in the TOC project although I have added a comment just to clarify your problem case.

            Paul Curren added a comment - Kendziorra. As you have found, that particular case does not work very well although it is a different issue from this one. An issue already exists in the TOC project although I have added a comment just to clarify your problem case.

            Kendziorra added a comment -

            Should it work?
            I've got a testaccount with confluence on demand, but there is no change?
            I tried to add a

            {toc}

            to an

            {excerpt}

            and to include this in an other page

            Kendziorra added a comment - Should it work? I've got a testaccount with confluence on demand, but there is no change? I tried to add a {toc} to an {excerpt} and to include this in an other page

            Anchor generation in Confluence 4.0 no longer has this problem.
            Confirmed fixed for both the include and toc macro cases described here.

            Paul Curren added a comment - Anchor generation in Confluence 4.0 no longer has this problem. Confirmed fixed for both the include and toc macro cases described here.

            In an old version there was an wrong implemented undocumented parameter absoluteUrl=true (for TOC).
            see here: https://studio.plugins.atlassian.com/browse/TOC-42 On this site are a patch for the wrong implementation.

            May be this param (absoluteUrl=true) is a way to solve this problem. If someone want to use an anchor link included in an other site, he have to set this parameter ???
            But needed to implemented !? It's only an idea.

            Kendziorra added a comment - In an old version there was an wrong implemented undocumented parameter absoluteUrl=true (for TOC). see here: https://studio.plugins.atlassian.com/browse/TOC-42 On this site are a patch for the wrong implementation. May be this param (absoluteUrl=true) is a way to solve this problem. If someone want to use an anchor link included in an other site, he have to set this parameter ??? But needed to implemented !? It's only an idea.

            Matt Ryall added a comment -

            This affects the table of contents macro as well. Recently reported as CONF-21713.

            Matt Ryall added a comment - This affects the table of contents macro as well. Recently reported as CONF-21713 .

            Matt Ryall added a comment -

            Sorry, it looks like most of the comments and votes here are actually about the

            {include}

            macro, and we have a bunch of duplicate issues resolved against this one.

            I'll reopen it and rename the issue so it makes more sense.

            Matt Ryall added a comment - Sorry, it looks like most of the comments and votes here are actually about the {include} macro, and we have a bunch of duplicate issues resolved against this one. I'll reopen it and rename the issue so it makes more sense.

              Unassigned Unassigned
              ewong@atlassian.com Ernest Wong (Inactive)
              Affected customers:
              22 This affects my team
              Watchers:
              18 Start watching this issue

                Created:
                Updated: