Created
August 12, 2020 10:50
-
-
Save AlexandrYZ/677c40924f2062ddd9c43b7e4d4c426d to your computer and use it in GitHub Desktop.
Confluence incoming links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Macro title: incoming links - selected space | |
## Source - https://community.atlassian.com/t5/Answers-Developer-Questions/Get-incoming-links-with-in-a-user-macro/qaq-p/538128 | |
## @param Space:title=Space|type=spacekey | |
#set($incLinks = $action.getIncomingLinks()) | |
#if($incLinks && $incLinks.size() > 0) | |
<ac:structured-macro ac:macro-id="180b25d1-981f-410d-8fc7-b979b17f8ca2" ac:name="panel" ac:schema-version="1"> | |
<ac:parameter ac:name="title">Links to this page from $paramSpace space</ac:parameter> | |
<ac:rich-text-body> | |
<p><ul> | |
#foreach ($incLink in $incLinks) | |
#if(!($incLink.getSourceContent().isDeleted()) && $incLink.getSourceContent().getSpace().getKey()==$paramSpace) | |
<li>[<a href="$generalUtil.htmlEncode("${req.contextPath}$incLink.getSourceContent().getSpace().getBlogTabUrlPath()")"> ($incLink.getSourceContent().getSpace().getName())</a>]<a href="$generalUtil.htmlEncode("${req.contextPath}$incLink.getSourceContent().getUrlPath()")">$incLink.getSourceContent().getTitle()</a></li> | |
#end | |
#end | |
</ul></p> | |
</ac:rich-text-body> | |
</ac:structured-macro> | |
#end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment