Get external data into nested 'each' function

  • Hi

    I have three collections: Days, Theatres, Sessions. All of which are related to each other in the sessions collection.

    What I want to do is iterate through Days, then Theatres, then Sessions in order to output a calendar to pdf.

    I am trying to use nested 'each' function calls to do this.

    The problem is that the second collection in the loop 'Theatres' doesn't contain any reference to the 'Day' data so that I then cannot filter 'Sessions' by day using the $item variable.

    Is there any way to get a variable from the first collection into the third collection call?

    I've got it working by manually creating a set of collection data for each day by setting the 'day.day_title' filter manually (there are only 2 days at the moment) but it would be great to automate the whole thing in the page template.