Hi Jeremie,
Jeremie BOUSQUET wrote:
Hi all,
This problem is driving me nuts...
I try to retrieve some HTML content from a field of a specific object, and
display it in a page (rendered, not as code).
I wrote this kind of code, and it's the unique content of my page :
{{velocity filter="none"}}
{{html clean="false" wiki="false"}}
#set ($obj = $doc.getObject("MyClass"))
#set ($htmlbody = $obj.bodyhtml)
#set ($htmlbody = $htmlbody.replaceAll(" ", "
").replaceAll("<","<").replaceAll(">",">").replaceAll("<br/>","").replaceAll("&",
"&").replaceAll(""", '"'))
What happens if you replace the 2 lines above with:
#set($htmlbody = $obj.getProperty("bodyhtml").value)
Hope this helps,
Marius
<div class="mail_body_html">
$htmlbody
</div>
{{/html}}
{{/velocity}}
The replacements are here because, for any reason, I could not manage to
store my HTML in the field without having many characters substituted in the
process (like "<" and such), and line break tags are inserted randomly, but
the resulting string looks like regular HTML content (I debugged it in
server logs).
Problem is that, when rendered, this page shows the following :
{{html clean="false" wiki="false"}}
[... html content rendered ...]
So there are 2 problems IMO, and I really don't see from where they come :
- my {{html}} macro is not understood by the wiki engine
- even if not understood, the page understands the $htmlbody is html and
renders it like that. But it assumes wiki="true", and so, for example, all
links are broken (replaced by bunches of "<span
class="xwikilink""), and the
result is not clean
Thanks,
Jeremie
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users