aemsightlyhtlImplementing custom Options in Adobe AEM HTL (formerly known as Sightly)?
This question is about Options, a feature in Adobe's proprietary language HTL
:
My simple question: Can I extend HTL by implementing my own custom Options? If so, how?
Solution
Yes, you can implement your own custom options for an HTL expression. You will need to implement a Filter and add it to the compiler.
But you shouldn't, as:
- This is not a designed extension point. You will need to fork the implementation and modify it, thus becoming responsible for keeping it up-to-date further down the road.
- You can most probably get the same results by using the public APIs (such as https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/master/SPECIFICATION.md#221-use).
- In case you think there's a very good reason for adding or modifying expression options, you can propose an HTL specification change (and also contribute the implementation in Sling).