我可以在我包含的另一个文件中使用变量吗?
在我的 HTL (file1.html) 中,我有:
<sly data-sly-test.myVar="${properties.myVarFromDialog}"></sly>
<sly data-sly-include="/file2.html"></sly>
我可以在 file2.html 中使用 myVar 吗?我没有得到任何值(value)。有没有办法从 file1.html 获取该值以在 file2.html 中使用
最佳答案
您应该为此使用 data-sly-template 。您可以在单独的文件中定义模板并可以传入参数。有关模板的说明,请查看以下文档链接 http://docs.adobe.com/docs/en/aem/6-0/develop/sightly.html#template
关于adobe - AEMsight 如何重用变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45325568/