[ 
https://issues.apache.org/jira/browse/SLING-7999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16681181#comment-16681181
 ] 

Radu Cotescu commented on SLING-7999:
-------------------------------------

[~klcodanr], thanks for assigning the issue to me. I somehow missed it.

[~tml], unfortunately your change adds an option that should first be a part of 
the specification [0], since it extends the applicable options for 
{{data-sly-list}} and {{data-sly-repeat}}. On the other hand, I think you can 
already do this, with a bit of elbow grease:
{code}
<ol data-sly-use.l="logic.js" data-sly-set.list="${l.list}" 
data-sly-list="${list}">
 <li>${item} is ${itemList.count} of ${list.size}</li>
</ol>
 {code}

[0] - 
https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.4/SPECIFICATION.md#226-list

> Add a `length` property to the AbstractRepeatPlugin
> ---------------------------------------------------
>
>                 Key: SLING-7999
>                 URL: https://issues.apache.org/jira/browse/SLING-7999
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>    Affects Versions: Scripting HTL Java Compiler 1.0.26-1.4.0
>            Reporter: Joey Smith
>            Assignee: Radu Cotescu
>            Priority: Trivial
>             Fix For: Scripting HTL Java Compiler 1.1.0-1.4.0
>
>
> I have created a PR to add a length property to AbstractRepeatPlugin; this is 
> primarily intended to allow users to do things like "Item <X> of <Y>" when 
> using a data-sly-list; the count/index property could already be used to 
> derive the X, but it seemed there was no simple way to access the Y.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to