Page properties image path from listChildren loop | Community
Skip to main content
adamm42245876
Level 2
December 20, 2017
Solved

Page properties image path from listChildren loop

  • December 20, 2017
  • 5 replies
  • 1202 views

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!

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 smacdonald2008

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

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.

5 replies

Feike_Visser1
Adobe Employee
Adobe Employee
December 21, 2017

What do you mean with "page image"?

adamm42245876
Level 2
December 21, 2017

It's a page property

smacdonald2008
Level 10
December 21, 2017

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

adamm42245876
Level 2
December 21, 2017

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

smacdonald2008
smacdonald2008Accepted solution
Level 10
December 21, 2017

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

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.