How can I dynamically assign iteration values to a list? I would like to use parameter values sent in from the URL to iterate specific parts of a list of articles.
This is the code I am working with -- and it is return the error below the code:
"<sly data-sly-set.listStart="${request.parameterMap.start}"/>
<sly data-sly-set.listEnd="${request.parameterMap.end}"/>
<ul data-sly-use.list="com.adobe.cq.wcm.core.components.models.List"
data-sly-list.item="${list.listItems @ begin=listStart, step = 1 ,end=listEnd}"
data-sly-use.template="core/wcm/components/commons/v1/templates.html"
data-sly-use.itemTemplate="item.html"
data-sly-test.itemType="${properties.itemType ? properties.itemType : 'item'}"
class="cmp-list paginatedList">
<sly data-sly-call="${itemTemplate[itemType] @ list = list, item = item}"></sly>
</ul>"
"org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Operands are not of the same type: comparison is supported for Number types only."
Is there a way to assign a numeric data type in HTL?