Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
None
Description
Attached images do not show up in Blog.WebHome because the ArticleClass instance fields are not rendered in the appropriate context. A quick hack for users with programming rights consists in modifying Blog.Macros to set the right document before rendering like this where $bentryobj is an ArticleClass instance:
#set($content=$bentrydoc.display("content", "view", $bentryobj))
#set($olddoc = $context.context.doc)
$!context.context.setDoc($bentrydoc.document)$bentrydoc.document.getRenderedContent($content, $context.context)$!context.context.setDoc($olddoc)
I have to explicitly set $bentrydoc as the document in the context, but this does not seem like good practice. It looks like there is an issue with included and including documents in the rendering api, particularly in radeox rendering, although I have not looked at the other renderers. It seems to me that XWiki object instances should be rendered in the context of their document instance no matter what the XWikiContext happens to be, but I'm not aware of the full implications of changing the code to enforce this, particularly with respect to form handling.
Attachments
Issue Links
- depends on
-
XWIKI-744 XWikiDocument.getRenderedContent and XWikiDocument.display do not set the proper document in the context
- Closed