Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

How to pass curly brace inside sightly expression?

Avatar

Level 2

Hi, I have snippet like this:

<sly data-sly-use.svg="${'/apps/foobar/svg.js' @ pngPath={{iconPath}}, iconSize='xs', title={{label}}, desc='', alt={{label}}}">

                                ${svg.html @ context= 'unsafe'}

                            </sly>

I'd like to pass the handlebars expression using double curly braces '{{ foo }}' to the sightly variable, but I got error

token recognition error at: '{'

I think it because sightly process curly brace and not bypass it. How can I pass that curly brace?

Thank you.

1 Accepted Solution

Avatar

Correct answer by
Level 3

I'd like to pass the handlebars expression using double curly braces '{{ foo }}' to the sightly variable, but I got error

token recognition error at: '{'

This is not possible, sightly is executed at server, the handlebars variable is available only on the client browser.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 3

I'd like to pass the handlebars expression using double curly braces '{{ foo }}' to the sightly variable, but I got error

token recognition error at: '{'

This is not possible, sightly is executed at server, the handlebars variable is available only on the client browser.