All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Implementing recurring events by adding Occurences channel

Susan Wohlgemuth 12 Mar 2013 19:30 question, complete

Could you please elaborate on how to use related entries to implement recurring events?
I have my channel called "schedule" that has about 12 fields. The code below is the abbreviated version.

Then I created a new channel called Occurences that has one Low Events field called "occurence_date" and a relationship field to the channel 'schedule' called "occurence_event".

{exp:low_events:entries channel="schedule" unit="year" limit="1000" dynamic="yes"} 
<ul>
<li>{if dates:one_day} {dates:start_date format='%n/%j'}
{if:else} {dates:start_date format='%n/%j'}-{dates:end_date format='%n/%j'}{/if}</li>
<li><a href="{title_permalink='regattas/regatta-details/'}"><strong>{title}</strong></a></li>
<li>{if host_url != ""}<a href="{host_url}" target="_blank">{host}</a> {if:else}{host}{/if}</li>
</ul>
{/exp:low_events:entries}


1. Does each recurring event need to be a separate entry? Could I put multiple Low Events fields in the Occurences channel?
2. Related entries aren't my strong point. Could I get some help with getting the related entries into the above template.

Thank you
Susan

Replies

  1. Low 12 Mar 2013 20:13

    Let me explain it with an example. Say you have workshops and you give the workshop multiple times. Each workshop is the same, except for the date on which it is given. In this scenario, you can create two channels: workshops and occurrences.

    The Workshops channel contains the name and description.
    The Occurrences channel contains the Low Events field and a relationship field so you can choose a single Workshop. With this you're effectively saying "this workshop is on this day". For each time the workshop is given, you create another entry in Occurrences.

    To display the calendar/list of events, you need to target the Occurrences channel, since that's the channel with the Low Events field. Then, for each entry in the loop, you can refer to the relationship field to get all the details for the related workshop. Look at the native docs to see how: http://ellislab.com/expressionengine/...

    Hope that helps.

  2. Susan Wohlgemuth 12 Mar 2013 22:26

    If I understand correctly then, for each event, a event entry must be posted PLUS an occurrence entry for each occurrence. In my case, the events are sailing regattas. Most events during the year are 1 or 2 day events. No need for recurring entries. But there are several series throughout the year where the same regatta will be held every Sunday for several months, and I want each one listed on my event calendar.

    If we decided that it was worth it to have a regular events channel, and then additionally a 'recurring events' channel plus 'occurrences' channel just for the recurring events, would I be able to display the recurring events in the correct date order with my non-recurring events? The events are displayed in a list by month, and they all need to be in order.

    Thanks
    Susan

  3. Low 13 Mar 2013 12:45

    Sure, you can have a regular events channel, and 2 channels for the recurring events as per the setup above. Then you can combine the regular events and occurrences as one big list.

    However, it might be easier just to create a separate entry (event) in the regular events channel for each occurrence instead of having to deal with 2 extra channels.

  4. Susan Wohlgemuth 14 Mar 2013 05:05

    Well I think I'll give the extra channels a try and see how it works. Thanks for your input.

    Susan