adobe / adobe/htl-spec

data-sly-list and data-sly-repeat with previous and next item reference

Open
#95 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
288
Forks
142
PR merge metrics
No merged PRs in 30d

Description

### Expected Behaviour
For data-sly-list and data-sly-repeat there should be a prepared object reference to the previous and next item in the list. It is not right to have a dedicated custom SlingModel function for that, as I see a lot of useless code in a lot of SlingModels to get previous or next elements. It is also no business logic having next item e.g. if you have list items that have a button to get e.g. the label to the next or previous item. As workaround for next I can use the count field, but that is a hack and this is not working for previous item.

### Actual Behaviour
https://github.com/adobe/htl-spec/blob/master/SPECIFICATION.md#226-list

#### Sample Code that illustrates the problem
```


key: ${item}
value: ${myMap[item]}
Click here to go to previous item: ${item.prev.label}
Click here to go to next item: ${item.next.label}

```

Contributor guide

Open the contributing guide

Research direction

Start with the linked List section of SPECIFICATION.md and the sample data-sly-repeat markup. Check how item and count are currently defined, then determine precise prev/next semantics, including first and last items and map iteration. Done means the specification clearly defines these references and includes a consistent example.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.