Can you use relative links in Confluence OnDemand page?

I have content that I need to mirror from a public space to an internal space with the Excerpt and Excerpt Include macros. But any links contained within those macros are absolute, i.e. they target the space with the Excerpt macro and not the space using the Excerpt Include macro, even if both spaces have pages with the same names. Is it possible to create relative links, so that links in an excerpt always target the current space?

3 answers

Hi Erica,
the issue is that the standard macros from Atlassian work with the exporting space. So "include" and "excerpt-include" first evaluate the macros, then import the resulting content into the targetpage.

A "toc" macro will give you the table of contents from the exporting page.

You might be able to use "multi-excerpt" addon or the "Theme-Builder" Addon. The later has a macro "import", which does things differently.

"Import" does import the content incl. not-executed-macros first, THEN executes the macros. Thus, a "toc" macro will give you the table of the importing page, not the referenced page.

Let us know what worked :)

Hi Erica,
the issue is that the standard macros from Atlassian work with the exporting space. So "include" and "excerpt-include" first evaluate the macros, then import the resulting content into the targetpage.

A "toc" macro will give you the table of contents from the exporting page.

You might be able to use "multi-excerpt" addon or the "Theme-Builder" Addon. The later has a macro "import", which does things differently.

"Import" does import the content incl. not-executed-macros first, THEN executes the macros. Thus, a "toc" macro will give you the table of the importing page, not the referenced page.

Let us know what worked :)

Import doesn't help, because I don't want to have to update content in two places after I import. But I was able to figure out a workaround using the Multiexcerpt macro, by using anchors instead of absolute links. As long as both spaces have the same page names and anchors, an anchor will target the page/anchor in its own space even if the anchor is part of an "Include" macro from another space.

Hi, about "import", thats justbthe name of the macro. You still have only one source. About multi-excerpt, sounds clever, jave to try it some time :)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Featured Groups

Tuesday tips & tricks: What is the Atlassian Community?

It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...

51 views 2 4
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you