0

I have a client that presents weekly webinars that are set up as recurring events within Solspace Calendar. When a user registers for the event, they receive a link to the following icalendar tempate:

{exp:calendar:icalendar
    event_id="{segment_3}"
    limit="1"
}
{/exp:calendar:icalendar}

The problem is that the ICS file contains all occurrences of the event, which then prompts Outlook to create a new calendar, and iCal and Google Calendar to create multiple events.

How can isolate a single occurrence, and only output that to the ICS file?

I've checked the documentation, and there is no mention of using occurrence_id tags in that context.

Any help is appreciated.

1 Answer 1

0

Have you tried limiting the event by day? I used this addon for a client recently and found the documentation a little perplexing at times. Luckily, the support was good. However, after playing with it for a while, I was able to achieve everything I needed. It's a pretty powerful addon. The tags you display in your post are pretty simplified. Go through the docs again and review the optional tags available to use. You should be able to limit the output by start date. I had to do this for individual sale dates. You have limit used, but I don't even think limit is a parameter calendar even uses.

Something like this maybe?

{exp:calendar:icalendar
    event_id="{segment_3}"
    date_range_start=" (whatever the date that this event starts) "
    date_range_end=" (again, the day you want to show) "
    show_days="1"
}
{/exp:calendar:icalendar}

Not sure this will do it, but the docs should get you there. Depending on how you set up the ability to build the event in the fieldtype determines what parameters you can use and what results you get as well. Depending on how you have that set up, you may have to output an event and then pass that to an embed to get your desired result. You really have to sit and read through the entire documentation to get your head wrapped around this addon.

* EDIT *

Like I said, you may have to get creative with things to get what you are after. I don't know your setup, so I can't say what would work, but I'll show you what I ended up with to get my desired results.

Due to the way my clients wanted the ability to enter events in every possible way, I had to logically break everything out. Luckily, performance didn't drop any noticeable amounts.

I started by looping through the days and checking for events.

{exp:calendar:cal
    date_range_start="today"
    date_range_end="today"
    pad_short_weeks="n"
    status="open|closed"
}
    {!-- Loop through all days and check them --}
    {display_each_day}
        {!-- Ensure that there is an event on this day --}
        {if day_event_total > 0}
            {!-- Loop through all events --}
            {events}
                {!-- There was an event so we will process the information for the sale --}
                {embed="_includes/_event_details" event_id="{event_id}"}
            {/events}
        {/if}
        {!-- Ensure that there is NOT an event on this day --}
        {if day_event_total == 0}
            {!-- No events today. Display message and show upcoming sale instead --}
            {embed="_includes/_next_sale"
                dyn_title="NEXT"
            }
        {/if}
    {/display_each_day}
{/exp:calendar:cal}

For limiting the "Next" sales, I used the cal tags again with the event_limit to limit it to a single event.

{exp:calendar:cal
    event_limit="1"
    date_range_start="today"
    date_range_end="365 days"
    pad_short_weeks="n"
    status="open|closed"
}

Not sure if you could loop through the single days of an event and build the ical from a single day or not though... ???

For any of the details, I used an embed to process the event tags using the passed id.

{exp:calendar:events
    event_id="{embed:event_id}"
    dynamic="no"
    event_limit="1"
    status="open|closed"
}
{/exp:calendar:events}
4
  • I've been all through the documentation, and been in touch with support. According to them "Unfortunately I don't believe there's a way around this, as Calendar expects that you're wanting the whole event and its recurrences." We're probably going to have to break out each occurrence into its own entry,
    – Ty Morton
    Commented Feb 12, 2016 at 16:13
  • I did try your idea, BTW. The result was the same. The template is still targeting a single channel entry, and then gathering all of the data contained within. Thanks for the effort, though.
    – Ty Morton
    Commented Feb 12, 2016 at 16:14
  • That's why I said it depends on how you have it set up. I got a similar answer from support, but was able to get around that by using embeds.Let me pull up some of the old code to see if itmight help
    – W3bGuy
    Commented Feb 12, 2016 at 16:17
  • included the old code from what I ended up with. I didn't have time right now to go through the previous revisions that used the iCal tags though. Sorry. Hope it maybe helps. ???
    – W3bGuy
    Commented Feb 12, 2016 at 17:17

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.