1

I have two different event types in my Events channel. The first one is events and it is very straightforward: Title, Description, Date. The other one is films and it is a little more complex: Title, Description, Screening(s) - which is 1 or more Date/Time. (I am using a supertable to allow the user to add as many screenings as they would like).

I have it set up like this to keep the administration of the content as DRY as possible - as all screenings of a movie will share the same description, title and other meta data.

I need to display all of my events and film screenings in an agenda view - sorted by date. How do I accomplish something like this?

The problem, if it isn't obvious, is that screenings from films could be staggered amongst screenings from other films so a simple for loop doesn't do the trick. I need to get all of the events and screenings (an individual screening being an "event" in this case) into an array that I can sort.

Thank you for any ideas or tips ahead of time.

1 Answer 1

1

One thing you could do is have all screenings be Events, and then have Films be a type which contains the film's data, but use relationships to link to multiple Events which are the film's screening times. You could even have Events have two entry types: Events and Film Screenings (or something similar to this) so they could be displayed differently in the agenda view, and Film Screenings could link back to their parent Film entry.

Here's more information about using relationships and reverse relationships: https://straightupcraft.com/articles/introduction-to-relations-and-reverse-relations-in-craft-cms-with-examples

I'm not sure if this solution would fit your needs, but given my understanding of your issue, I think this is how I'd try to tackle it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.