Jump to:

10842 Posts in 2513 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Feeding a Google Calendar into a page

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1853 Views
  • pixelstuff
    Avatar
    Community Member
    8 Posts

    Feeding a Google Calendar into a page Link to this post

    I was wondering if it's possible to display a Google Calendar feed on a calendar grid in a SilverStripe site.

    I am coming from the MODx CMS where they have a Google Events snippet that uses SimplePie to reformat the XML feed into the necessary HTML for a calendar table or just about any other markup you want.

    An example of it is here http://test.ebenezerbaptist.com in the "Upcoming Events" sidebar container. I used jQuery to display the events one at a time. The snippet also has a preset calendar table that can be used for a full sized month view (which I haven't styled and therefore haven't embeded yet).

    Does anyone know if something similar can already be done, if not does anyone want to work on something that will do this? Either a new module or perhaps modifying the current Event Calendar module to accept Google Calendar feeds.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Feeding a Google Calendar into a page Link to this post

    Hi, pixelstuff,

    The current development effort in the EventCalendar project is to add this feature, so you're in luck. It will also accept one-time imports of ICS files for those who are migrating calendars. So stay tuned!

    The hard part has been finding a reliable ICS parser for PHP. Anything you could send my way would certainly help out a lot.

  • pixelstuff
    Avatar
    Community Member
    8 Posts

    Re: Feeding a Google Calendar into a page Link to this post

    You said a reliable parser. What have you tried already?

    For example could the iCal parser in PHP iCalendar not be integrated?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Feeding a Google Calendar into a page Link to this post

    PHP iCalendar does not use a standalone parser. When I took a look at it, it had a bunch of different contingencies and it just didn't look like anything modular that I could port over to the EventCalendar. I've also looked at ICSReader, but the problem is it splits the file into lines, so events with multi-line descriptions break, because it thinks everything after the first line of that description is a new property. I've tried rewriting the regex, but it's way beyond me.

    Any help you could offer would be appreciated!

  • pixelstuff
    Avatar
    Community Member
    8 Posts

    Re: Feeding a Google Calendar into a page Link to this post

    Would the information here help you?
    http://developer.apple.com/internet/appleapplications/icalendarfiles.html

    The page discusses php and pearl methods for parsing.

    I also came across this discussion on the parser for phpiCalendar. It is discussing plans for v3.0 I think.
    http://phpicalendar.net/forums/viewtopic.php?f=58&t=2041

  • UncleCheese
    Avatar
    4085 Posts

    Re: Feeding a Google Calendar into a page Link to this post

    Great! Thank you! I must have an old version of PHP iCalendar.

    I like this comment on the Parser class:

    "please be careful with the explode with spezial characters. a ":" or ";" may also occure in the DESCRIPTION: part."

    EXACTLY!!

  • pixelstuff
    Avatar
    Community Member
    8 Posts

    Re: Feeding a Google Calendar into a page Link to this post

    Something else that looked interesting.
    http://www.kigkonsult.se/iCalcreator/

    1853 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.