Skip to main content
selvaganesh
Level 5
Oct 16, 2015 2:28 AM UTC
Solved

variable within variable in sightly

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 ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Feike_Visser1
Feike_Visser1Accepted solution
Adobe Employee
Oct 16, 2015 2:28 AM UTC

this works for me..:

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

5 replies

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
Oct 16, 2015 2:28 AM UTC

this works for me..:

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

Translate
selvaganesh
Level 5
Oct 16, 2015 2:28 AM UTC

It didnt work

Translate
selvaganesh
Level 5
Oct 16, 2015 2:28 AM UTC

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

Translate
Runal_Trivedi
Level 6
Oct 16, 2015 2:28 AM UTC

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

- Runal

Translate
Adobe Employee
Oct 16, 2015 2:28 AM UTC

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

Translate