title: AEM 6.0 Sightly Child Nodes
body: <p>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.</p>
  
  <pre><code>&lt;div class="${wcmmode.edit ? 'image-edit image' : 'image'}" data-sly-resource="${ 'heroImage' @ resourceType='/libs/foundation/components/image', appendPath='image', selectors='fileReference' }"&gt; &lt;/div&gt;
  </code></pre>
  
  <p>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 </p>
  
  <pre><code>&lt;h1&gt;${ properties["heroImage"] }&lt;/h1&gt;
  </code></pre>
  
  <p>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.</p>
  
  <p>Thanks,
  Harry</p>