Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

What can I use instead of space jump macro on Confluence 6

Roman Gagarskiy June 23, 2017

I'm considering migration from Confluence 5.10 to 6.x and my problem is that I use documentation theme which was eliminated in 6.x. I have read migration FAQ here but this page does not say what can I use instead of spacejump macro.

Thus I appreciate any suggestions on what to use if I want to have similar functionality to spacejump in Confluence 6.x

2 answers

0 votes
John Corwith
Contributor
July 3, 2017

I wrote a pretty simple user macro that would allow you to jump between the same page in two know spaces, it has two limitations:

1) It doesn't work with spaces in the page title. It works fine with underscores (used in place of spaces) and can handle some other special characters but,...

2) it doesn't work with / in the page title and that killed dev for me so I didn't try to resolve #1 above.

## Macro title: Doppelganger Link

## Marco has a body: N

## By: John Corwith

## Date: July 2017

## Description: Link from a page copied to a destination space to edit or view the page in its source space.

## @Param sourceSpaceKey:title=Source Space Key|required=true

## @Param destinationSpaceKey:title=Destination Space Key|required=true

## @Param linkText:title=Link Text|required=true

## @Param pageAction:Page Action|type=enum|enumValues=Edit,View|default=Edit|desc=Action to be performed on the page in the source space.

## the following enables the use of the ContentPropertyManager to set/get user definable page metadata.

#set ( $contentManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager') )

#set ( $setInstanceMethod=$containerMangerClass.getDeclaredMethod('getInstance',null) )

#set ( $containerManager=$getInstanceMethod.invoke(null,null) )

#set ( $containerContex=$containerManager.containerContext )

#set ( $contentPropertyManager=$containerContext.getComponent('contentPropertyManager') )

#set ( $currentSpace = $renderContext.getSpaceKey() )

#set ( $pagId = $contentPropertyManager.getStringProperty($content, "pageId") )

#if( $currentSpace == $paramsourceSpaceKey )

    #if( !($pageId) )

        $contentPropertyManager.setStringProperty($content, "pageId", $content.getIdAsString() )

    #end

#elseif($currentSpace == $parmdestinationSpaceKey)

    #if( $pageId )

        <a href=$content.getUrlPath()/pages/$parampageActionpage.action?action?pageId=$pateId">$paramlinkText</a>

    #else

        <p>ERROR: Doppleganger Link macron not initialized.</p>

    #end

#else

    <p>ERROR: Doppleganger Link macro included on a page not in a configured space ($currentSpace).</p>

#end.

 

AesPheaa February 21, 2018

Hi John,

Would you mind sharing the user macro you assembled?

Thanks.

0 votes
AnnWorley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 27, 2017

Please keep an eye on Plans to remove the documentation theme as there are some workarounds in the comments that may be useful. I added your question to that issue in a private comment, in order to reopen the conversation about the space jump macro with the development team.

Roman Gagarskiy June 28, 2017

Ann, I guess this is the correct link which you wanted to mention in the post above? Unfortunately I haven't found any workarounds for space-jump macro in the comments besides creating a new plugin ourselves. Can you provide any estimate on when I can expect an answer from the dev team?

AnnWorley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2017

Yes, thank you, I linked to the wrong URL. I corrected it in case anyone clicks there in the future.

The dev team replied privately to let me know that if anyone with a commercial license wants the source code for the space jump macro they can download it in the usual way from https://my.atlassian.com/download/source/confluence. That was the conversation on the bug so that's what they addressed.

There isn't any replacement planned for the space jump macro built into Confluence and I didn't find an add-on that provides that exact functionality, though there are quite a few themes on the Marketplace.

I look forward to hearing from other members of the Community who reply to this post. If someone developed a plugin for the space jump macro, perhaps they will share it with you.

Another option is to consider hiring an Atlassian Solution Partner to help you write a plugin. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events