Community Documentation

iCal feeds (Exporting and Importing)

Last updated April 30, 2013. Created by iantresman on March 6, 2012.
Edited by Anthony Fok. 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

Comments

iCal feed for selected Organic Groups

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

Under #3, "Importing an iCal

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...)

About this page

Drupal version
Drupal 6.x
Level
Beginner
Audience
Programmers

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.