【发布时间】:2016-11-11 05:20:48
【问题描述】:
在 AEM 6.2 中,我想在车把中执行此操作。
<sly data-sly-resource="${'title' @ resourceType='myproject/components/content/common/title'}"/>
具体来说,我覆盖了 qnaforum.hbs 并需要将其包含在其中。官方文档(link)说正确的做法是:
{{include this.id path="title" resourceType="myproject/components/content/common/title"}}
这样做有三个问题:
- 组件出现,然后从页面上消失。
- 我收到警告“在客户端包括 sling 时不支持强制资源类型”
- 在浏览器控制台中有一个对http://localhost:4502/content/myproject/qna-index-page/jcr:content/qna-parsys/qna/title.html 的失败(404) GET 请求(就像它试图在该路径中查找标题资源的渲染器一样)。
在同一个 qnaforum.hbs 文件中,Adobe 为其订阅组件使用了相同的包含,而且它似乎工作正常。
{{include this.id path="subscriptions" resourceType="/libs/social/subscriptions/components/hbs/subscriptions"}}
这种类型的包括仅适用于社交社区组件吗?如果是这样,我如何在车把模板中包含自定义资源?
【问题讨论】:
标签: handlebars.js aem sling sightly