Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,483
Community Members
 
Community Events
165
Community Groups

Render in user macro another page

I have my own macro for include page with specific version. It's works like Confluence Include Macro. But I have a problem: every attachment in included page is not displayed. For example, images shown like "Unknown Attachment", however html elements are ok.

Screenshot from 2021-07-19 11-36-05.png

How to render included page with attachments?

This is my macro:

## @Param Page:title=Page|type=confluence-content|required=true|desc=Select page

## @Param PageVersion:title=PageVersion|type=int|required=true|desc=Write page version

#set ($ss='')
#set ($sp='')

#foreach ($p in $paramPage.split(":"))
#if ($ss=='')
#set ($ss=$p)
#else
#set ($sp=$p)
#end
#end

#if ($sp=='')
#set ($sp=$ss)
#set ($ss=$space.key)
#end

## Get the Page object instance
#set($page=$pageManager.getPage($ss, $sp))
#set($paramPageVersion=$generalUtil.convertToInteger("$paramPageVersion"))
#set($tp=$pageManager.getPageByVersion($page, $paramPageVersion))

#if($page.getId()==$content.getId())
Error! Cannot insert page into itself
#elseif($tp)
#set($body=$tp.getBodyContent().getBody())
$body
#else
Error! Wrong version $paramPageVersion! The latest page version is $page.getVersion()
#end

1 answer

0 votes
Fabian Lim Community Leader Jan 19, 2022

HI @Kirill Golovkin

Do you have any logs that you can share to understand the root cause?

Thanks

Hi!

It was so long time ago. So I haven't logs now. I leave this problem without solution( 

Thanks for interest! 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Confluence: Where work and wellness meet

Feeling overwhelmed by the demands of work and life? With a 25% increase in the prevalence of anxiety and depression worldwide during the pandemic, for most of us, it’s a resounding yes . 🙋‍♀️ ...

1,031 views 18 28
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you