iCal feeds let you share your and/or import your events that are stored in Sitefinity. Here is a library that will let you generate an iCal feed from Sitefinity. Future versions of this library might have us filtering by categories or date.
iCal feed for Sitefinity CalendarHandler_2
I’ve made a few changes since the last release to include some bug fixes.
- Added Google and Outlook friendly fields in the feed file to describe the iCalendar file as well as the publisher.
- Added code to the
Descriptionfields to keep them at 75 characters or less to comply with the iCal specifications.
First, you need to tell ASP.NET about your new handler. Open up the web config file and look for the
httpHandlers section, it’s the parent is
system.web and add the following:
1 <add verb="GET" path="GetICSFile.ashx" type="SEVDNUG.Web.HttpHandlers.CalendarHandler, App_Code"/>
Note: The path name can be changed to any legal value like
CalendarHandler.cs files to the
App_Code directory of your Sitefinity installation.
Getting the event data from Sitefinity and creating the iCalender objects is handled inside the
The class assumes that your events provider is named
Events, if not you will have to change line 25 of the class.
The class maps the following fields to an iCalendar event.
|iCalendar event||Sitefinity Field|
|Location||LocationName (Meta Field)|
|Summary||Title (Meta field)|
I believe these meta values are the default meta keys from Sitefinity. If your values differ, you can modify them on lines 64 and 65.