Sightly - how to get child resource

Avatar

Avatar

Jedrzej84

Avatar

Jedrzej84

Jedrzej84

15-10-2015

Hi All,

I have searched how to get child resource from "resource" object in sightly, but haven`t found any answer.

I know that I could read property of child node, but I include parsys in my component and want to list children of parsys.

As a workaround I do

<div data-sly-list.parsys="${resource.listChildren}" data-sly-unwrap> <ul data-sly-list.item="${parsys.listChildren}"> ... process item ... </ul> </div>

 

how to have sth like:

${resource.parsys.listChildren}

 

Thanks for your help 🙂

View Entire Topic

Avatar

Avatar

akashs51893872

Avatar

akashs51893872

akashs51893872

10-08-2018

This might work in this case:

<sly data-sly-use.parsys="${resource.path}/parsys" data-sly-list="${parsys.listChildren}">
     <pre>${item.name}</pre>
</sly>

We can work with resources with data-sly-use.

Good Luck...