This macro lets you enter a page name, and prints "This is the <Page Name> page in the <Space Name> space"
## @param PageToInclude:title=Page to Include|type=confluence-content|required=true|desc=To specify a page in a different space, use SPACEKEY:Page Title.
#if ( $paramPageToInclude.indexOf(":") == -1 )
#set ( $spaceKey = $space.key )
#set ( $contentTitle = $paramPageToInclude)
#else
#foreach ( $part in $paramPageToInclude.split(":") )
#set ( $spaceKey = $part )
#break
#end
#foreach ( $part in $paramPageToInclude.split(":") )
#set ( $contentTitle = $part )
#end
#end
<br>
This is the
<ac:link>
<ri:page ri:content-title="$!contentTitle" ri:space-key="$spaceKey"/> $!contentTitle
</ac:link>
page in the
$spaceManager.getSpace($spaceKey).getName()
space.
The <PageName> line is a link to the page, and it works. The <SpaceName> displays the name of the space correctly. But when I try to make the <SpaceName> line into a link, like this:
<ac:link>
<ri:page ri:content-title=$spaceManager.getSpace($spaceKey).getName()>
</ac:link>
...it doesn't show the full name. For instance, it says "Testing" instead of the correct name, "Testing Space", and of course the link it creates is dead.