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

Avatar

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

Avatar

Correct answer by
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

Avatar

Employee

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

Avatar

Community Advisor

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

- Runal

Avatar

Correct answer by
Employee

this works for me..:

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