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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 18 hours ago in Off-topic

Get to know our Atlassian User Group Leaders from Bengaluru, India

Meet @Dinesh Dhinakaran, @Vishnu Vasudeva, @Rajeev Verma, and Jamshid Nalakath: Our extraordinary AUG leaders from Bengaluru, India. These four work together to strengthen the bonds of their local co...

127 views 0 4
Read article

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