Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Links to each other on the Confluence pages

Ed Izotov June 25, 2014

I created the special template for Use Case creation in Confluence. And I'd like to link pages between themselves. Is there some way to link pages like Jira (or other bug-trackers)? When I insert the link on the 1st page, reverse link is created too on the second page. I'd like to create a custom field fot this in my template

1 answer

1 accepted

2 votes
Answer accepted
Davin Studer
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.
June 26, 2014

You can do this pretty easy with a user macro. Here is what it would look like.

Macro name:
referring_content

Macro title:
Referring Content

Macro Body Processing:
No maco body

Template:

## Developed by: Davin Studer
## Date created: 06/26/2014
## @noparams

#set($containerManagerClass=$content.class.forName('com.atlassian.spring.container.ContainerManager'))
#set($getInstanceMethod=$containerManagerClass.getDeclaredMethod('getInstance',null))
#set($containerManager=$getInstanceMethod.invoke(null,null))
#set($containerContext=$containerManager.containerContext)
#set($linkManager=$containerContext.getComponent('linkManager'))

#set($pages = $linkManager.getReferringContent($content))

#foreach($page in $pages)
    <a href="$page.getUrlPath()">$page.getTitle()</a><br/>
#end

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events