Jump to:

10986 Posts in 2724 Topics by 1817 members

All other Modules

SilverStripe Forums » All other Modules » ICS iCal importing, $content on the Event Calendar Module

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1857 Views
  • 3pointross
    Avatar
    Community Member
    18 Posts

    ICS iCal importing, $content on the Event Calendar Module Link to this post

    I am trying to import a feed of announcements but I am having a but of trouble getting it to render properly.

    You can see what is going on here -> http://howellv2.stagedsite.net/

    Everything looks great but the content ends prematurely and we are getting a bunch of '\' characters as well.

    Any help / insight would be great

  • UncleCheese
    Avatar
    4085 Posts

    Re: ICS iCal importing, $content on the Event Calendar Module Link to this post

    Nice site!

    I see all the events in the right hand column. Is there something I'm missing? Also, make sure there's no HTML in your ICS feed. I'm not sure that I'm filtering the ICS content for HTML at this point.

  • 3pointross
    Avatar
    Community Member
    18 Posts

    Re: ICS iCal importing, $content on the Event Calendar Module Link to this post

    Thanks for the response UncleCheese, much appreciated.

    If you look at the descriptions below any given listing, it only outputs a line or two before it ends. For example "Don't miss the traditional start of the holiday season in the H" is maybe only 1/3rd of the total description on the calendar but thats all that gets rendered on the page.

    The descriptions don't have any HTML at this point. It looks like (my guess) for some reason google has manual line breaks in long descriptions and because the ICS is parsed with explode("\r\n" it thinks that is the end of the description?

  • UncleCheese
    Avatar
    4085 Posts

    Re: ICS iCal importing, $content on the Event Calendar Module Link to this post

    Yeah, that's a very unfortunate bug in the ICS import class I'm using. It's all line-break based, so if your description has one, it ends the field there. I tried for a while to give it some new logic to tolerate line-breaks circumstantially, but I just couldn't make it work. If you're a programmer, look at that ICSReader (?) class and see what you can come up with. I'd really love to fix this.

  • coffeymachine
    Avatar
    Community Member
    10 Posts

    Re: ICS iCal importing, $content on the Event Calendar Module Link to this post

    I have found a quick workaround to this problem.

    1. Open up the event_calendar/code/iCal.php file
    2. Uncomment lines 42-44 (as of revision 83)
    3. On line 42 replace "END:VEVENT" with whatever comes right after the end of your description in your .ics file. I am importing from Google Calendar, so for me I put "LAST-MODIFIED". You will need to open up the .ics file you are importing and see what comes after the description.

    This may not work if you are importing .ics files from different sources with slightly different formats, but I am only importing from Google Calendar so this does the trick. If anyone can find a better fix for this please let me know.

  • UncleCheese
    Avatar
    4085 Posts

    Re: ICS iCal importing, $content on the Event Calendar Module Link to this post

    That's a great fix. Thanks. It's true that the varying sources of ICS outputs is the most problematic issue with the imports. ICS is supposed to be a standardized format, but there's so little information about it. You'd think this stuff would have been figured out by now.

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