Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Calendar: New Feature

Go to End

8 Posts   3279 Views


Forum Moderator, 4102 Posts

18 June 2009 at 5:39am

The Event Calendar now supports importing ICS feeds. For those of you who are not familiar with ICS, it's a normalized data format like XML, but specifically for calendars. When you click the "add to calendar" link in the module, it returns an ICS file that is readable by your calendar to add the event to iCal, Google Calendar, Outlook, etc.

With the new import feature, you can now import a static ICS file from your calendar. Just select one, several, or all of your events in your calendar tool, and run and export to an ICS file. This can be done very easily in Google Calendar and iCal. Then, place the file in event_calendar/import/YourFile.ics. Now, go to the URL (Note the ".ics" is not needed). You should see a series of green success messages indicating the events have been added to the database. Anything that didn't make it through will return a red error message and the index of the attempted event in your ICS file.

But wait, there's more! ICS files can also be read as continuous, dynamic feeds to a calendar. If you're using shared calendaring, chances are you have a live ICS file living somewhere out on the web. With Google Calendar, it's very easy to get a URL for your calendar in XML, KML, or ICS format. Simply click on the "Feeds" tab on your Calendar page, and enter a title and a URL for the feed you'd like to include in your calendar. Now, every time a calendar page is viewed, it will mix in the latest data from your feed(s).

The only limitation is that because we don't always know too much about the events being imported, they currently come in as Announcements only. One way around this might be to examine the length of the Content or Summary property of the event and determine, if more than X characters, the import becomes a full event, and not an announcement. I find that most events created on a calendar tool like iCal, however, do not have long descriptions, and are best served as Announcements on your calendar.

I have not thoroughly tested this change. I have had success with two iCal exports and one Google feed. Test away, and enjoy.


Community Member, 28 Posts

9 August 2009 at 11:51am


Hi, although a newbie to all this, would like no comment as follows:
Have just tested the included ics feed. Including a Google calendar via the feed tag shows up correctly, but does not allow the RSS feed from my calendar anymore. Seems there is a typing error somewhere, as without an included ics feed, first line of source code from RSS feed in my calendar starts correctly with "<?xml version="1.0"?>". Including the ics feed, first line of source code from RSS feed in my calendar starts with "_<?xml version="1.0"?>", whereas underliune is a blank one... This throws out a XML error message.
Still a nice and very usefull module, thanks for that....



Forum Moderator, 4102 Posts

9 August 2009 at 12:48pm

A good lesson in why you should never close your PHP tags unless you're templating. That whitespace messes everything up!

Run an SVN update and let me know how it works for you. Seems to have fixed the bug for me.


Community Member, 28 Posts

10 August 2009 at 3:36am


thanks, that worked. Just updated to r66 and RSS Feed is working now.



Community Member, 128 Posts

21 November 2009 at 1:29am

My google publicly shared calendar ICS is (.ics removed)

but my when I select Calendar (not extended) it accepts this URL but nothing is imported and attempt to access blows up

GET /testsite/test/

Line 23 in /Applications/MAMP/htdocs/testsite/event_calendar/code/iCal.php


14 function iCalClean($file) {
15 return strpos($file, '.ics');
16 }
18 function iCalReader() {
19 $array = $this->iCalList();
20 foreach ($array as $icalfile) {
21 $iCaltoArray[$icalfile] = $this->iCalDecoder($icalfile);
22 }
23 return $iCaltoArray;
24 }
26 function iCalDecoder($file) {
27 $ical = file_get_contents($file);
28 preg_match_all('/(BEGIN:VEVENT.*?END:VEVENT)/si', $ical, $result, PREG_PATTERN_ORDER);
29 for ($i = 0; $i < count($result[0]); $i++) {

Line 279 of Calendar.php
Line 371 of Calendar.php
Line 765 of Calendar.php
Line 550 of ViewableData.php
Line 591 of ViewableData.php
Line 82 of
Line 354 of SSViewer.php
Line 346 of SSViewer.php
Line 175 of Controller.php
Line 129 of RequestHandler.php
Line 122 of Controller.php
Line 29 of ModelAsController.php
Line 277 of Director.php
Line 121 of Director.php
Line 118 of main.php

My event_calendar is 83 Victor


Forum Moderator, 4102 Posts

21 November 2009 at 3:18am

What is the error? It doesn't look like you have pasted the entire output.


Community Member, 128 Posts

21 November 2009 at 4:28am

Yes true: Headers

[Notice] Undefined variable: iCaltoArray
GET /testsite/test/

Line 23 in /Applications/MAMP/htdocs/testsite/event_calendar/code/iCal.php


PS It is event_calendar without changes v83


Community Member, 128 Posts

26 November 2009 at 12:08am

It looks like error was due to strange name collision: I called site "testsite" and event was "test"

Still while there is no error anymore (when I renamed event) no event is coming

I use event_calendar_r83