-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support map literals #63
Comments
Any progress or additional thoughts on this, @kwin ? I'd love to see this make the Sightly/HTL asap, as we often end up creating backend logic for something as simple as adding a query string parameter to a URL. It would be nice if a JSON-like syntax is supported, even though that could be tricky since { and } already have a special meaning. Especially since we're already supporting a JavaScript array syntax ([1, 2, 3]). Are there any technical complications in using the JSON notation that you suggested? Or has this just not been a priority yet? |
This would rather be a question for @raducotescu. Any plans on a new HTL spec version where this could be included? |
I think it should be the normal javascript object initializer, allowing unquoted keys, and references to other variables. eg:
as a workaround, you can define the object in your use class. |
@raducotescu any update? |
@henrykuijpers, it's something we're discussing internally. As soon as we reach a conclusion we will post it here. |
Any way to vote on this proposal? I am also in favor, and agree JSON syntax seems like the way to go. |
Currently it is not possible to create map literals (consisting of several key/value pairs) in HTL expression language. This would be especially handy for passing request attributes (see https://issues.apache.org/jira/browse/SLING-5812) which may now be given to
data-sly-include
. Currently one needs to have some backing code in JavaScript or Java to be able to use that option.Maybe JSON notation would work
The text was updated successfully, but these errors were encountered: