【问题标题】:Render HTML inside velocity includeInContext() XWiki在速度 includeInContext() XWiki 中渲染 HTML
【发布时间】:2016-04-18 07:12:01
【问题描述】:

我有两个空格。一个是“查看”页面,另一个是“工具”页面。我想在视图的上下文中通过我的 wiki 在各种“视图”页面上呈现“工具”。目前,在我使用的“查看”页面中:

{{velocity}}
#includeInContext("Interfaces.tool.WebHome")
{{/velocity}}

这很好用,我可以使用“工具”页面中的代码检索“查看”页面的子项或数据,这正是我想要的。

但是,如果我包含:

{{velocity}}

 {{html wiki="true"}}
   <tag ... html></tag>
 {{/html}}

{{/velocity}}

在“工具”页面中,html 仅在“视图”页面中呈现为文本。我也尝试将 {{html}} 标签移动到“查看”页面或 wiki="false",但没有运气。还有其他想法可以尝试吗?也许除了 includeInContext() 之外的其他函数?

【问题讨论】:

    标签: velocity xwiki


    【解决方案1】:

    #includeInContext 已部分弃用。您应该使用新的 {{include}} wiki 宏,在您的情况下看起来像:

    {{include reference="Interfaces.tool.WebHome"/}}
    

    您也不需要视图页面中的 {{velocity}} 包装器,只需 {{include}} 宏。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-25
      • 1970-01-01
      • 2011-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-13
      • 2015-09-17
      相关资源
      最近更新 更多