Last updated April 30, 2013. Created on March 6, 2012.
Edited by Anthony Fok, iantresman. Log in to edit this page.

iCal (or iCalendar) is an Internet file format (sometimes called a feed) for exchanging calendar information (such as events) between people. By converting your Drupal events into an iCal feed, you can export your events to others, for example, so people can import your events into Google Calendar.

Likewise, by reading an iCal feed from another source, such as from Google Calendar, you can export events from Google Calendar and import the events into Drupal.

Enable the iCal module

The first step toward either importing or export iCal feeds, is to install the Calendar module, and enable it together with the Calendar iCal module. Other modules are required, as indicated on the Administrator's Module page (ie. Views).

Exporting: creating your own iCal feed

When the Calendar and iCal modules are enabled...

Go to Views (Admin | Site building | Views), where you will see a new "Default Node view: calendar (Calendar)". It is disabled by default and greyed out. Click the Enable link to enable it.

I recommend that you do not Edit the new Calendar view (think of it as your master copy). So click "Clone" to make a copy, give the cloned calendar view a relevant name (eg. icalview). Then click Next to go your new view edit screen.

You will see a list of pre-defined views (under Default). Click iCal feed to begin to create it, and away you go!

Importing an iCal feed (eg. from Google Calendar)

You can import iCal feeds into Drupal in several ways:

1. Importing iCal directly into a Calendar view
I think this method has been superseded by the next option, but I'm leaving this section until it is confirmed.

2. Importing iCal using Feeds
You can import iCal feeds into Drupal with the Feeds module and its associated iCal feed parser. See also:

3. Importing iCal into CCK fields

In addition to enabling the Calendar and iCal modules, you must also enable the the Date module, and its Date Tools and Date Repeat API modules. (iCal used to require Date Copy, but this is now part of Date Tools).

In Admin, in Content management select the new "Date Tools" option. Then select the Date Wizard. iCal is mentioned in the introduction.

There is a little more information in Advanced Help | Date API | Date Copy (misnamed! It is now part of Date Tools)

See also

Looking for support? Visit the forums, or join #drupal-support in IRC.


mark_anthony’s picture

I have set up a Calendar with a filter exposed for all the Organic Groups.
The user can select one or more Groups to filter for the Events for that Group to display in the calendar — that all works fine.

url returned (for two groups) is: .../calendar-teams?group_nid%5B%5D=1159&group_nid%5B%5D=1160

What I cannot for the life of me get to work is to have an iCal feed correctly generated from the same filtering. There is an attached iCal feed to the Calendar page, but it returns a feed of all the Events from every Group.

Also (but for now not a major issue) when I copy the iCal url and try to use it to subscribe there is a an error; if I download the iCal file, then open it, it works (but as I said, displays all Events for every Group).

Looking for help in proper settings in Views to get the iCal to create feed for just filtered Groups' Events to work.

I should add some spec's:
Drupal 6.25
Calendar 6.x-2.4
Date 6.x-2.8

bcobin’s picture

Under #3, "Importing an iCal feed," the information isn't relevant - not for current D7 versions, anyway.

As of this writing (6/6/12) there seems to be no solution for importing iCal feeds into Drupal 7 calendars with PHP 5.2 - yikes!

OOPS! I see there's a D7 thread - sorry 'bout that... (wish I could delete...)

BastouBach’s picture

I am posting this here as it took me a long time to figure this one out!

Using: Drupal 6, Date 6.x-2.9, Calendar 6.x-2.4.

The goal is to add an “add to Google or iCal” link on each event node.

First, you need to create your event content type with a date field. Make sure the granularity of the date field is set to at least hour. If not, the timestamp in the ical feed will not have a time and will not work.

Then, follow instructions under Exporting: creating your own iCal feed above

The views config:

Edit the iCal feed display: In the filters, click on the gear icon for the Date: Date (node) and change the date field to Content: Start Date.
Add an argument of Node: Nid. Action to take if argument is not present:Check Provide default argument and Node ID from URL. Validator: Node, Type: Event (or whatever your node type is).
In the fields, delete the Updated date and add the Start date field.
Add a Node:Link field. Rewrite the output of this field: [view_node].ics

Next Add a Block Display (this is to display your link in a block). Filter on node of type Event. Add an argument of Node: Nid. Action to take if argument is not present:Check Provide default argument and Node ID from URL. Edit the field of Node: Nid. Rewrite the output of this field. Text: Add to Google or iCal calendar. Output this field as a link. Link Path: calendar/[nid]/ical. Remove the other fields.

Add the block to your Event nodes.

csheriff’s picture

Excellent instructions! Very clear and concise! I was able to add the link to my website with no problems.
Thank you so much!

Topplestack’s picture

I just wanted to throw this up here for anyone else who encountered my issue. If you are exporting an iCal view from a site with any of the popular node access modules installed and are getting empty feeds or encountering unexpected errors when importing the .ics file, make certain that the event nodes are visible to anonymous users. Otherwise the feed will return empty.