It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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
TAGS
Community showcase
Posted in Confluence

Lessons and Learnings: Six Months of Working Remote [Discussion]

Hey there, folks! For most of us, the past six months- yes, you read that right- have been a journey. More people than ever before have pivoted to working remotely, and navigating being on-scre...

8,501 views 6 6
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you