Model 有没有办法在AEM中生成唯一的资源名称?
我创建了一个表,其中包含一个列表。它将生成许多行。但是,我必须使Model 有没有办法在AEM中生成唯一的资源名称?,model,osgi,sling,sightly,aem-6,Model,Osgi,Sling,Sightly,Aem 6,我创建了一个表,其中包含一个列表。它将生成许多行。但是,我必须使资源名称每行都是唯一的。有什么想法吗 <table> <thead> <tr> <td></td> </tr> </thead> <tbody data-sly-
资源名称
每行都是唯一的。有什么想法吗
<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>
我不确定你打算在那里做什么。似乎您希望生成唯一的合成资源名称 为此,您可以使用
itemList.count
或itemList.index
来获得如下值:res1
,res2
。。。或res0
,res1
。。。看
您可能需要使用数据集
将数字连接到文本:
<tbody data-sly-list="${itemCount}">
<tr>
<td data-sly-set.resourceName="res${itemList.count}">
<div data-sly-resource="${resourceName @ resourceType='components/content/mycomponent'}"></div>
</td>
</tr>
</tbody>