I'm facing another challenge with Solspace Calendar and relationships. I have the usual Events channel and a separate Organisations channel. Entries in the Events channel have a multiple relationships field that allows the event to be related to organisation(s).
As an example, a recurring 'Book Club Meeting' event might be associated with the 'Book Club' entry in the Organisations channel.
Each organisation has its own page on the website and I want to show a list of any upcoming events that are associated to that organisation.
I have tried the below but it shows all events and not just those that are related to the entry I'm looking at. This code doesn't look right to me but I'm not sure what else to try.
{exp:channel:entries channel="organisations" require_entry="yes"}
{parents field="event_organisations" channel="calendar_events" limit="5"}{if parents:count == '1'}<!-- Start Upcoming -->
<section id="upcoming" class="events">
<div class="hd">
<h2 class="heading"><a href="/events">Upcoming Meetings & Events</a></h2>
</div>
<div class="bd">
<!-- Start Entry Listing -->
<ul class="entries">{/if}
{exp:calendar:events date_range_start="today" show_months="1" pad_short_weeks="n" event_limit="5"}<li class="entry event">
<h3 class="name"><a href="{path='events/event'}/{if edited_occurrence}{event_parent_id}{if:else}{event_id}{/if}/{event_start_date format="%Y/%m/%d"}">{event_title}</a></h3>
{if event_all_day}
<time class="eventdate" datetime="{event_start_date format="%Y-%m-%d"}">{event_start_date format="%j<sup>%S</sup> %F %Y"}</time>
{if:else}
<time class="eventdate" datetime="{event_start_date format="%Y-%m-%dT%H:%iZ"}">{event_start_date format="%j<sup>%S</sup> %F %Y <i>at</i> %g:%i%a"}</time>
{/if}
</li>{/exp:calendar:events}
{if parents:count == parents:total_results}</ul>
<!-- End Entry Listing -->
</div>
<div class="ft">
<a href="/events">See full diary of events</a>
</div>
</section>
<!-- End Upcoming -->{/if}{/parents}
{/exp:channel:entries}
How can I extract information about events and occurrences based on parent relationships?