Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Sep 15, 2017 8:42 AM UTC

Hey,

Following is the way:

<div data-sly-test.variable123="${currentPage.name}" data-sly-unwrap></div>

And can later use it like:

<div data-sly-test="${yourName}">....${variable123}</div>

Reference Post:- How to set convenience variables in sightly?

To know more about HTL (formerly known as Sightly) :- HTL introduction part 1

~kautuk

Kautuk Sahni

3 replies

kautuk_sahni
kautuk_sahniAccepted solution
Level 9
Sep 15, 2017 8:42 AM UTC

Hey,

Following is the way:

<div data-sly-test.variable123="${currentPage.name}" data-sly-unwrap></div>

And can later use it like:

<div data-sly-test="${yourName}">....${variable123}</div>

Reference Post:- How to set convenience variables in sightly?

To know more about HTL (formerly known as Sightly) :- HTL introduction part 1

~kautuk

Translate
Kautuk Sahni
Ricky99999
Level 4
Sep 15, 2017 9:09 AM UTC

Thanks kautuksahni​

Translate
RahulBGPandey
Level 2
Sep 5, 2024 4:18 PM UTC

Hi Ricky,

 

One way to create a variable without using a data-sly-test is to use a data-sly-set that works as an assignment operator. You can create a new variable and assign it a value.

<sly data-sly-set.name="myname"></sly>

 

Thanks

Translate