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

Rendering Confluence content in Dynamic Content Macro with bodyType "rich-text"

Jan Jonas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 19, 2020

Hey there,

is there any way to make sure the Confluence content gets rendered 100% correctly (including all required scripts and styles) in a Dynamic Content Macro with bodyType "rich-text".

In my Dynamic Content Macro, I try to render Confluence content by using the API /wiki/rest/api/contentbody/convert/{to} (see https://developer.atlassian.com/cloud/confluence/rest/#api-group-Contentbody) to convert the Confluence storage format into HTML. The returned HTML is then rendered in the marco's iFrame.

This basically works but fails for "complex" Confluence elements (such as a Jira issue macro). For those elements, the necessary CSS and/or JavaScript seems to be missing. 

I found this page https://ecosystem.atlassian.net/wiki/spaces/CONF/pages/293994679/Rendering+Confluence+content+using+the+content+rest+API but I'm not sure of the information is outdated or not. I have no idea where how to access variable "res" on the client side (for example to resolve "res.webresource.uris.js").

I'm wondering if there is any standard solution for this problem as I expect that all Dynamic Content Macro with bodyType "rich-text" have the same problem.

Thanks in advance!

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian community events, ace, engineering, confluence feed, power of feed, atlassian ask me anything, atlassian confluence answers, ace rsvp, atlassian community events rsvp, atlassian magic

“How We Built This” ft. Atlassian Confluence Engineers

Meet the engineers who are making the Confluence magic happen at Atlassian ✨

RSVP now!
AUG Leaders

Upcoming Confluence Events