[英]Render HTML inside velocity includeInContext() XWiki
I have two spaces. 我有两个空格。 One is the "view" page and the other is the "tool" page.
一个是“视图”页面,另一个是“工具”页面。 I want to render the "tool" on various "view" pages through my wiki, within the context of the view.
我想在视图的上下文中通过我的Wiki在各种“视图”页面上呈现“工具”。 Currently, in the "view" page I use:
当前,在“视图”页面中,我使用:
{{velocity}}
#includeInContext("Interfaces.tool.WebHome")
{{/velocity}}
This works fine and I can retrieve for example the children or data of the "view" page with the code in the "tool" page, which is what I want. 这可以正常工作,我可以使用“工具”页面中的代码来检索“视图”页面的子代或数据。
However, if I include an: 但是,如果我包括:
{{velocity}}
{{html wiki="true"}}
<tag ... html></tag>
{{/html}}
{{/velocity}}
In the "tool" page, the html is only rendered as text in the "view" page. 在“工具”页面中,html仅在“视图”页面中呈现为文本。 I've also tried moving the {{html}} tags to the "view" page or wiki="false" but with no luck.
我也尝试过将{{html}}标记移到“视图”页面或Wiki =“ false”,但是没有运气。 Any other ideas to try?
还有其他想法可以尝试吗? Maybe some other function than includeInContext()?
也许除了includeInContext()以外的其他功能?
#includeInContext
is partially deprecated. #includeInContext
已部分弃用。 You should use the new {{include}}
wiki macro, which in your case would look like: 您应该使用新的
{{include}}
Wiki宏,您的情况如下所示:
{{include reference="Interfaces.tool.WebHome"/}}
You don't need the {{velocity}}
wrappers in the view page either, just the {{include}}
macro. 您也不需要在视图页面中使用
{{velocity}}
包装器,只需使用{{include}}
宏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.