Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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.