variable within variable in sightly | Community
Skip to main content
selvaganesh
New Participant
October 16, 2015
Solved

variable within variable in sightly

  • October 16, 2015
  • 5 replies
  • 2107 views

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.
Best answer by Feike_Visser1

this works for me..:

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

5 replies

Employee
October 16, 2015

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

Runal_Trivedi
New Participant
October 16, 2015

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

- Runal

selvaganesh
New Participant
October 16, 2015

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

selvaganesh
New Participant
October 16, 2015

It didnt work

Feike_Visser1
Feike_Visser1Accepted solution
Employee
October 16, 2015

this works for me..:

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