Date iCal is your one-stop shop for iCal support in Drupal. It provides a plugin for Views to enable outputting your site's calendar as an iCal feed, and a plugin for Feeds to enable import of external iCal feeds into your site's calendar.
Any entity which contains a Date field can be utilized by Date iCal for import and export of iCal feeds.
Date iCal 2.0 is a complete re-write of most of the project's internals. Rather than using Drupal's theme system to build the iCal output, we now use the iCalcreator library, by kigkonsult.
In addition, Date iCal 2.0 introduces the ability to import iCal feeds from other sites, through use of a Feeds plugin.
The dependencies for Date iCal 2.0 are as follows:
- Views 3.5+, Entity API, Date, and Libraries 2.0 are required.
- The iCalcreator library is required, and must be installed into the
sites/all/libraries/iCalcreatorfolder of your Drupal site.
- The Feeds module is optional, but it's needed to enable import of iCal feeds from other sites.
- PHP 5.3 is required by the iCalcreator library to properly handle timezone data. Date iCal might work with PHP 5.2, but that configuration is untested and unsupported.
To learn more about how to use Date iCal 2.0, please refer to the project documentation, which is linked from the Resources section in the right sidebar.
IF YOU ARE STILL USING Date iCal 1.x, PLEASE UPGRADE TO 2.x ASAP. Maintenance for the 1.x branch has been suspended, and the 1.x branch will be removed from Drupal.org in short order.
The following is the description of the 7.x-1.x branch, written by the previous maintainer of Date iCal. It doesn't apply to Date iCal 2.x.
This module contains code to create an iCal feed in Views. It has been pulled out of the Calendar iCal module because it has no dependency on Calendar and it could be used on any view. The code has also been generalized so that it will work for any entity, not just nodes. It creates a 'Feed' type of 'iCal' that can be added to any view, an 'iCal' view mode for every entity type that can be used to to configure the description used in the iCal feed, and adds theme suggestions to tell Drupal to look for an iCal version of the entity template if you want to create a custom template for the ical feed.
The Calendar iCal module will be deprecated in favor of this module.
Future plans for this module:
- Add in an iCal parser for the Feeds module that can parse an iCal feed from another site so it is possible to import as well as export iCal information.
- Add in ways to take advantage of other parts of the iCal specification, like LOCATION or VALARM.
- Add some pre-configured features that illustrate how to set up a site that provides an iCal feed and consume iCal information from other sites.
To use this module to create an iCal link on the bottom of a view page:
- Enable Date API, Views, and Date iCal.
- Go to the Display Fields screen for the entity you want to export in an iCal field. You will see that there is a new view mode for all entities, called 'iCal'.
- Set up the iCal view mode to contain whatever should be exported as the 'Description' field for the iCal field. You can trim the text to the desired size, include other fields, etc.
- Optional step, create a new node.tpl file for the iCal view mode, using the name ENTITYTYPE--ical.tpl.php or ENTITYTYPE--BUNDLE--ical.tpl.php. Make this a very simple template that omits the title, submitted by information, links, and comments. Place that file in the theme folder.
- Clear the cache so the new template can be discovered by Drupal.
- Create a new view that contains the items you want to display in the iCal feed.
- Add a feed to the view, using the feed type 'Date iCal'.
- Choose to 'Show' the feed as 'Date iCal Entities' (rather than 'Content' or 'Fields').
- In the settings for Date iCal Entities, select the specific date field that should be used as the event date for the iCal feed.
- Add date filters or arguments that will constrain the view to the items you want to display in the feed.
- Give the feed a path like 'calendar/ical/%/calendar.ics', where you have a '/%/' for every contextual filter in the view.
- Attach the feed to a page view.
- Navigate to the page view. You should see the iCal icon at the bottom of the view. If you click on the icon it will download an .ics file with the events that matched the view criteria.