我可以在 HTL 中用逗号分隔标签吗?

问题描述

我的问题是:我必须在 AEM Console 上自定义标记属性

我有这个元标记

<Meta name="tags" data-sly-test="${properties.tag}" content="${properties.tag}" />

如果一个 utent 在 AEM 控制台上添加更多属性,我需要这些属性用“;”分隔。

输出应该是:

<Meta name="tags" content="hello;world;laptop;screen"/> 

解决方法

您可以使用 join 选项 (https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#124-array-join):

content="${properties.tag @ join=';'}"