Jump to:

10993 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Has anyone successfully extended Event Calendar Module v. 3?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 257 Views
  • cmc
    Community Member
    23 Posts

    Has anyone successfully extended Event Calendar Module v. 3? Link to this post

    I'm trying to extend the Event Calendar module for registerable events. It's sort of working. Everything seems ok in the CMS and I can access the extended events using "Preview" from the CMS.

    However, none of the extended events show up in the calendar or upcoming events lists. It seems like this is due to a couple issues:

    1) getStandardEvents() in the Calendar class uses this query -

    DB::query("SELECT ID FROM SiteTree_Live WHERE ClassName = 'CalendarEvent' AND ParentID = $this->ID");

    ClassName='CalendarEvent' excludes extended events so I've tried using -

    DB::query("SELECT ID FROM SiteTree_Live WHERE ParentID = $this->ID");

    Should I make this change with a DataExtension instead of modify the Calendar class?

    2) EventID isn't being inserted into the CalendarDateTime table for extended CalendarDateTime. If I insert the EventID manually and use the modified query above the extended events are shown in the EventList.

    Any ideas on how to get the EventID to be inserted into the CalendarDateTime when the new DateTime is added?

    Here are snippets from my subclasses -

    class MyEvent extends CalendarEvent {
       public static $db = array(
          'MinAge'            => 'Int',
          'MaxAge'            => 'Int',

       public static $has_many = array (
          'DateTimes' => 'MyEventSession', //doesn't work at all unless the key is 'DateTimes'

    class MyEventSession extends CalendarDateTime {

    public static $db = array(
    'SessionName' => 'Text',
    'LastDayToRegister' => 'Date',
    'Price' => 'Int',
       'Capacity'    => 'Int',

    public static $has_one = array(
    'SpecialEvent' => 'MyEvent', //this doesn't work if key is 'Event'

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.