Skip to main content
Skip table of contents

Reference to Target or Source

Reference to Target or Source Space/Page not correct after Instantiation

Description

Because the PTC resolves Space or Page references on it’s own (if it is a valid Space or Page) it may happen that it does not behave as you expect.

In the following scenarios this might lead to unexpected behavior:

  • Template page (from an other space) should reference a page in the target space.

  • Template page (from an other space) should still reference a page in the source space.

  • Some Confluence and Third-Party Macros do not support invalid space-key input.

Solution and Workaround Example

Solution

Use the Default Placeholders:

  • __target_space_key__

  • __source_space_key__

Workaround Example

If invalid input is allowed:

You can combine the Default Placeholder with your page title as following:

  • __target_space_key__:Your Page Title

  • __source_space_key__:Your Page Title

If invalid input is not allowed:

You must first install a Storage Format editor (e.g. this one from Atlassian Confluence Source Editor). After installing this plugin, you can easily edit the storage format:

Find the <ri:page … /> or <ri:space … /> element for the macro where you have the problem and edit it as follows:

<ri:page ri:content-title="Your Page Title"/> results in:

CODE
<ri:page ri:content-title="Your Page Title" ri:space-key="__target_space_key__"/>

<ri:space ri:space-key="SPACEKEY"/> result in:

CODE
<ri:space ri:space-key="__target_space_key__"/>

Note:

If you want a reference to the source space, use __source_space_key__ instead of __target_space_key__

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.