Can you use relative links in Confluence OnDemand page?

Erica Warren July 14, 2014

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

0 votes
Erica Warren July 15, 2014

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.

Josch Bencke
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.
July 16, 2014
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 :)
0 votes
Josch Bencke
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.
July 15, 2014

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 :)

0 votes
Josch Bencke
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.
July 15, 2014

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 :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events