有没有办法在AEM中生成唯一的资源名称?

时间:2020-05-14 10:22:27

标签: model osgi sling sightly aem-6

我已经在tbody中创建了一个带有列表的表。它将生成许多行。但是,我必须使resource name每行都是唯一的。有什么想法吗?

    <table>
            <thead>
                <tr>
                    <td></td>
                </tr>
            </thead>
            <tbody data-sly-list="${itemCount}">
                <tr>
                    <td>
                        <div data-sly-resource="${'resourceName' @ resourceType='components/content/mycomponent'}"></div>
                    </td>
                </tr>
            </tbody>
        </table>

1 个答案:

答案 0 :(得分:1)

不知道我打算在那里做什么。看来您想生成唯一的合成资源名称。

为此,您可以使用itemList.countitemList.index来具有以下值:res1res2 ...或res0,{{1} } ...请参见details in the HTL specification

您可能必须使用res1将数字连接到文本:

data-sly-set
相关问题