Ok, my mind is about to implode with this… any help on template syntax very welcome!
I have 2 Sections: ‘artists’ and ‘schedules’
In the ‘schedules’ section I have a Matrix field called ‘stageSchedule’, with a Block type called ‘dayOfEvent’
In that Block type I have a Super Table field called ‘schedule’. - breakdown....
- schedules (Section)
- stageSchedule (Matrix) > dayOfEvent (Block)
- schedule (Block field (Super Table)) - ST
In ‘schedule (ST)’ I have a date field called ‘timeOn’, which is when the artist is due to be on stage. I thought I could get this information from ‘schedule (ST)’ by having an ENTRIES field called 'act' (in the same ST field) which is linked to a specific artist from the ‘artists' section.
What I want to do... On the individual ‘Artist Bio’ pages I want to display what time they’re going to be on stage by pulling that information from ‘schedule > stageSchedule (M) > dayOfEvent (B) > schedule (ST) > ‘timeOn’.
I have tried every which way but I either get an error or nothing at all :/
I hope that makes sense... Thanks to anyone who can work this one out!
EDIT
As a test I created a Super Table field on it's own (not within Matrix) and got the data correctly using this:
{% set reverseRelatedElements = craft.superTable.getRelatedElements({
relatedTo: {
targetElement: entry,
field: 'testTimes.artist' // Super Table Field
},
section: 'schedules’
}) %}
{% for relatedEntry in reverseRelatedElements %}
{{ relatedEntry.testTimes.timeon|datetime('H:i') }}
{{ relatedEntry.testTimes.timeOff|datetime('H:i') }}
{% endfor %}
So basically I need to do the same but target a Super Table field nested in a Matrix field? Here's an image...