Hi @sven.schatter, thank you for the help! Sorry it took so long for me to reply, I was trying some combinations but it’s still not working…
the converted view it’s missing local resources: styles, images… so I’m not seeing what I see in the editor, and it’s in fact quite broken.
I tried /rest/api/contentbody/convert/view and /rest/api/contentbody/convert/styled_view but none is returning what I see in the editor view
the styled_view looks a little bit better…
And the JS code:
var url = '/rest/api/content/' + pageId + '/history/' + pageVersion + '/macro/id/' + macroId;
httpClient.get({
url: url
}, function(error, response, body) {
var macro = JSON.parse(body);
//convert macro.body to view
httpClient.post({
url: '/rest/api/contentbody/convert/styled_view',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json; charset=utf-8'
},
json: {
"value": macro.body,
"representation": "storage",
"contentIdContext": pageId
}
},
function (err, httpResponse, body) {
return res.render('expand2-macro', {
macroTitle: title,
toggleId: Math.random() * 2.147483647E9,
macroExpanded: expanded,
macroBody: body.value
});
});
});
am I doing something wrong? is there something else you can suggest?
Thanks!