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

variable within variable in sightly

selvaganesh
Level 6
Level 6

I want to access one sightly variable in another sightly object .

Eg :

i have one sightly variable ${temp} which is an integer

I want to use the above variable in sightly array variables  ${variable.arrayObj[${temp}]}

Is there any i can access ${temp} with the array object ?

1 Accepted Solution
Feike_Visser1
Correct answer by
Employee
Employee

this works for me..:

<div data-sly-list="${[0,1]}">
item ${item} value ${properties.cq:tags[item]}<br/>
</div>

View solution in original post

0 Replies
kalyanar
Employee
Employee

can you try   ${variable.arrayObj[temp]}

Runal_Trivedi
Community Advisor
Community Advisor

have u tried following  ${variable.arrayObj[temp]} ?

- Runal

selvaganesh
Level 6
Level 6

 ${variable.arrayObj[temp]} did not work

Feike_Visser1
Correct answer by
Employee
Employee

this works for me..:

<div data-sly-list="${[0,1]}">
item ${item} value ${properties.cq:tags[item]}<br/>
</div>

View solution in original post