This document is for an older version of

Calendar

.

View latest version →

Calendar Calendar for ExpressionEngine

Calendar:ICS_Subscription template tag

The Calendar:ICS_Subscription tag works similarly to the Calendar:ICS_Export tag, but allows your users to subscribe (one way sync) their calendaring app to your sites' calendar(s) with an ICS subscription URL. This is compatible with popular calendaring programs such as Google Calendar, Apple Calendar, Microsoft Outlook, etc. This tag contains pre-formatted info, so you just need to specify the template tag and apply some parameters and link to it.

To enable this feature, make sure to enable ICS Sharing, click the green icon button in Manage column for the applicable calendar(s) on the list view of calendars in the Calendar control panel. Once enabled, you can then use this feature, or just copy the ICS URL from the CP (doesn't need this template tag approach) and share it with whoever you wish (admins, show it publicly, etc).

TIP

All event date data is stored as UTC+0, and retrieved as UTC+0. So, no matter where you are in the world, an event start date entered at 6pm will be stored and displayed always as 6pm. The Calendar:ICS_Subscription template tag compensates for this by setting the timezone to be floating, which (in the current example) means the event will show up at 6pm no matter what timezone the user is located in.

{exp:calendar:ics_subscription}
1

Parameters

hash=

hash="{segment_3}"

This parameter is fed the unique hash value associated with the calendar to be subscribed to. It basically takes place of passing a calendar ID, with the added benefit of the site admin being able to revoke subscription access from users at any time. The hash value is available as a variable within the Calendar:Calendars and Calendar:Events tags.

category=

category="{segment_4}"

This parameter allows you to export a specific set of events that belong to a category within a certain calendar by specifying a category ID. You can hardcode an category ID, pass it through an embed, or grab it from the URI.

Examples

The following code is a complete example for handling the subscription of If you wish to export a single event or calendar, your code would look something more like this:

{exp:calendar:ics_subscription
  hash="{segment_3}" {!-- Assuming you're linking to this template at something like site.com/calendar/ics-subscription/HASH --}
}
1
2
3