Adding Parsys in loop in sightly | Community
Skip to main content
October 18, 2016
Solved

Adding Parsys in loop in sightly

  • October 18, 2016
  • 4 replies
  • 5341 views

Hi All,

I need to add parsys in html as many times as my loop runs. Below is my code that is not working.

Parsys is a list with values par1, par2, par3 and so on.

<sly data-sly-list.parsys="${accordian.accordianParsys}" data-sly-unwrap>
        ${parsys}
        <div data-sly-resource="${@path='${parsys}', resourceType='foundation/components/parsys'}"></div>
    </sly>

 

Please advise.

Thanks,

Pradeep

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 pradeepdubey82

It worked like below 

<sly data-sly-list.parsys="${accordian.accordianSections}" data-sly-unwrap>
        <div data-sly-resource="${@path=parsys, resourceType='foundation/components/parsys'}"></div>
</sly>

smileysmileysmileyyesyesyes

4 replies

pradeepdubey82AuthorAccepted solution
October 18, 2016

It worked like below 

<sly data-sly-list.parsys="${accordian.accordianSections}" data-sly-unwrap>
        <div data-sly-resource="${@path=parsys, resourceType='foundation/components/parsys'}"></div>
</sly>

smileysmileysmileyyesyesyes

Ratna_Kumar
October 18, 2016

Hi Pradeep,

Please mark it as solved :)

Thanks.
Ratna,

October 18, 2016

How to mark it solved? I couldn't find option 'solved'.

Feike_Visser1
Adobe Employee
Adobe Employee
October 18, 2016

This is also a great use-case for data-sly-repeat, no need for the wrapping <sly> element.