Calendar Documentation

Learn the basics, and get to know Calendar inside and out.

Calendar 1.x Docs

calendar.export function

The calendar.export template function lets you export all or specific calendar events as an ICS formatted file. This will cause the user to receive a file download dialogue, and allow them to import the event(s) into a calendaring app like Apple Calendar or Google Calendar.

Make sure to pass events without loading their occurrences, since the exporter uses the RRule to specify how it recurs!

Parameters #

  • Receives a list of events

Usage in Templates #

{% set events = craft.calendar.events({
    calendarId: [1, 3, 5],
    rangeStart: "1 year ago",
    rangeEnd: "5 years",
    loadOccurrences: false
})) %}

{{ craft.calendar.export(events) }}