Velocity macro : rendering of page content through "getcontent" method

I wrote a velocity macro which among other things gets the content of a page to display it in a cell table :


{{html wiki=“true”}}

#set ($docx = $xwiki.getDocument($!
#set ($content = $docx.getContent())
#set ($title = $docx.getTitle())
#set ($contentex = $docx.getTranslatedDocument($!request.language).content)
#set ($titleex = $docx.getTranslatedDocument($!request.language).title)

It words well except for the fact that the rendering is lacking key elements, including paragraphs etc. I am only getting bold entries right.
Am I missing a more appropriate method or a parameter?

I am getting this kind of rendering :

instead of this :


I tried to reproduce your problem but no problem here. One thing though, in your code it says:

{{html wiki=“true”}}

Have you tried replacing this with:

{{html wiki="true"}}

(notice the double quotes which differ)

Thanks! But is was only an artefact…
I think found the issue : in our context, the “content” property is part of a specific custom class object which seems to be replicated or referenced in the page itself, and everything is fine if I use the “content” object property instead of the page default “content”…

However I am now stuck with the translated versions. I am trying to get the “content” property of each translated page through this line of code, but nothing comes out ($translation is empty although it should not be as per visual inspection…) :

#set ($translation = $docx.getTranslatedDocument("$!request.lang").getObject('Documentation.Code.SectionClass').getProperty('content').value)