Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Page properties image path from listChildren loop

Avatar

Level 2

How can I get the url of a page image when looping through the children using sightly?

Here is what I have been trying with no success:

<div data-sly-list.subChild="${child.listChildren}">

     <img src="${subChild.image.properties.fileReference}">

</div>

Thanks!

5 Replies

Avatar

Employee

What do you mean with "page image"?

Avatar

Level 10

You want to locate an image in a page and try and get the URL that resolves the image?

Avatar

Level 2

It's an image set in a page property, yes.

Avatar

Level 10

You would need to get at the correct node under a page that has this property:

FF1.png

Personally - if I had that requirement, I would do that in the Java part of an HTL component and populate a collection and then simply write out the collection in the HTL component.