Search code examples
aemsightly

AEM HTL dynamic property name


Is there any way in HTL to use dynamic property name something like this

${class.map['prefix' + item.name]}

Solution

  • You could take advantage of data-sly-set to do a concatenation before the rendering:

    <sly data-sly-set.appended="prefix${item.name}">${appended}