adobe / adobe/htl-spec

Permit use of modulo operator within HTL conditionals

Open
#94 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

The restriction to only allow logical and comparative operators in HTL means modulus operations can't be performed.

```



    ...

```

As well as using a constant ("5" in the example above) it should also be possible to use a HTL variable declared before the list or the result of a call into a Java model method, provided the value can be cast to an Integer.

While this does allow very limited business logic into the HTL layer, it's hard to see any other way of implementing a requirement within the list feature. This has been discussed in the past by other users here: https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/can-we-use-modulo-in-sightly/td-p/260156

Contributor guide

Open the contributing guide

Research direction

Start by reading the HTL specification's existing operator restrictions and the linked discussion about modulo support. Define how the modulo operator works with constants, previously declared HTL variables, and Java model results castable to Integer; done means the specification states these accepted cases and their constraints.

Written by the indexing model from the issue text.

Assessment

Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.