Child data not being fetched when displayed in template


#1

I have the following hasMany structure:

  • listing event – artist — image

listing event has many artists, artists have many images

when displaying a list of listing events the artists are fetched accordingly - however because images are another level down they aren’t. Totally get why.

However.

Say I am doing the following:

{{#each listingEvent in listingEvents}}

  {{#each artist in listingEvent .artists}}

    {{render "artist/artist-tile" artist}}

  {{/each}}

{{/each}}

And inside my render template I have the following:

{{#each image in artist.images}}

  {{image-helper image.url 'c_fill,h_30,w_20'}}

{{/each}}

I would expect images to be fetched? How can I force the images array to get populated from the server? I assume this is because the artists were already a level deep when they were initially fetched. But I would also assume that by accessing the property the images would be lazy loaded?

I am obviously misinterpreting something here. Thanks in advance for the help :slight_smile:


#2

Anyone got any clues on this?


#3

What is le.artists referring to? Shouldn’t it be listingEvent.artists?


#4

Apologies - I typed this directly on my phone on the train I think! I have corrected the text