Excerpt-include macro and links with anchors

Barbara Green October 10, 2011

I have release notes with a summary section and a details section. I use a link with an anchor to move from the summary to the details:

=========markup===========

h2. Highlights of This Release

{excerpt}

[Feature Label|Release Notes File Name#feature1anchor] --- Brief description of Feature 1.

[Feature2 Lable|Release Notes File Name#feature2anchor] --- Brief description of Feature 2.

{excerpt}

h2. Details

h3.{anchor:feature1}{color:#0c598a}Details of Feature 1{color}

A more detailed description...

h3.{anchor:feature2}{color:#0c598a}Details of Feature 2{color}

A more detailed description...

=====end markup==============

Then I use the excerpt-include macro to include the highlights (surrounded by excerpt tags) in a summary page for all of the releases (similar to Atlassian's Alldoc page). But the excerpts show the links as going to the summary (alldoc) page, rather than the original page. There is no error; the links look like they resolve, but they don't work.

Why is Confluence not using the explicit file name in the links in the original file?

Thanks,
Barbara

4 answers

2 votes
Alain Moran
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.
November 2, 2011

I suspect that this is related to a problem I have been experiencing while making changes to the comment move plugin.

What appears to be happening is that the new XML storage format stores links to the current page in a different format to those to other pages (despite the method of entering the link being the same), here is an example of the storage format for my comment:

<p>
  <ac:link>
    <ac:plain-text-link-body>
      <![CDATA[This comment was originally created on the Home page of the TEST space.]]>
    </ac:plain-text-link-body>
  </ac:link>
</p>
<p>
  <ac:link>
    <ri:page ri:content-title="PIN test" />
    <ac:plain-text-link-body>
      <![CDATA[This link was originally pointing to the PIN Test page in the TEST space.]]>
    </ac:plain-text-link-body>
  </ac:link>
</p>

You will notice that the first link does not contain an <ri> tag ... I suspect that because there is no <ri> tag then the renderer 'assumes' the current page, I dare say that this may be what's ocurring with the excerpt-include macro.

0 votes
Agnese July 23, 2019

This still remains a bug.

If you try to include a Table of Contents in an Excerpt, and then include that Excerpt in another page, none of the TOC links work.

0 votes
Tom Baker May 22, 2015

If you try to include a Table of Contents in an Excerpt, and then include that Excerpt in another page, none of the TOC links work.

This remains a bug.

0 votes
John Masson
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.
October 16, 2011

Hi Barbara,

I am not 100% sure in your specific case but it does sound like you might be hitting this bug which was related to using excerpt-include in an excerpt. Note that this has been fixed in Confluence 4.0.

Thanks,
John

Barbara Green October 16, 2011

Thanks for your response, but I don't think that is it. The excerpt renders correctly, it's just the links within the excerpt that are broken. I think it's really an instance of normal behavior, but one that does not work as I would expect it. It's acting like a Confluence move (changing the link source relative to the file where it's included), when it should act like a Confluence copy (maintaining the link relative to it's original location).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events