Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

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

Add Venue to Event Calendar Module


Reply


2 Posts   422 Views

Avatar
nmshah

Community Member, 21 Posts

5 January 2013 at 7:09am

I am using silverstripe 3.0.3 and Uncle Cheese's EventCalendar module and am trying to add location to the calendarevent using the following tutorial.

http://ss2doc-v2.ernie.silverstripe.com/old/recipes:extending_the_event_calendar

After following the tutorial when I try to rebuild the database I get the following error:

Parse error: syntax error, unexpected T_PUBLIC in C:\Program Files\EasyPHP-12.0\www\ichars\mysite\code\WorkshopDateTime.php on line 14

Line 14 on the above mentioned page are

public function extendTable()

I know the tutorial is for older version of the module but I couldn't find anything else. Kindly suggest...

Avatar
nmshah

Community Member, 21 Posts

10 January 2013 at 11:24pm

Edited: 10/01/2013 11:26pm

Have this working now. This is what I did:
Created a new page CalendarDetails.php in mysite/code/ with the following content:

class CalendarDetails extends DataExtension
{
   static $db = array(
      'Venue' => 'Text',
      'City' => 'Text',
      'Ticket' => 'HTMLText',
   );

   static $has_one = array (
      'Event' => 'CalendarEvent'
   );

   public function updateCMSFields(FieldList $fields) {

      $fields->push(new TextField('Venue', 'Venue'));
      $fields->push(new TextField('City', 'City'));
      $fields->push(new TextareaField('Ticket', 'Ticket'));
   }
}

and in _config.php added the following line:

Object::add_extension(‘CalendarDateTime’, ‘CalendarDetails’);