Skip to main content
Level 5
Oct 18, 2016 8:29 AM UTC
Solved

Adding Parsys in loop in sightly

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.
pradeepdubey82Accepted solution
Level 5
Oct 18, 2016 9:18 AM UTC

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
Level 5
Oct 18, 2016 9:18 AM UTC

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

Translate
Ratna_Kumar
Level 10
Oct 18, 2016 9:40 AM UTC

Hi Pradeep,

Please mark it as solved :)

Thanks.
Ratna,

Translate
Level 5
Oct 18, 2016 9:52 AM UTC

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

Translate
Feike_Visser1
Adobe Employee
Adobe Employee
Oct 18, 2016 11:44 AM UTC

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

Translate