I have a question around using Sightly to access child nodes of a component. I have a template which pulls in a basic image component using data-sly-resource, like so.
<div class="${wcmmode.edit ? 'image-edit image' : 'image'}" data-sly-resource="${ 'heroImage' @ resourceType='/libs/foundation/components/image', appendPath='image', selectors='fileReference' }"> </div>
What I would like to do is change the css class based on whether or not that image component actually has an image set. For this my plan was to access to the image component node and read its file reference. Something along the line of
<h1>${ properties["heroImage"] }</h1>
Unfortunately this doesn't work. My question is how can I access the fileReference of the heroImage resource from my template, seeing as its a child node.
Thanks, Harry