Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » EventCalendar and announcements

Discuss all other Modules here.

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

Page: 1 2 3 4 5
Go to End
Author Topic: 4658 Views
  • alexanm
    Avatar
    Community Member
    38 Posts

    EventCalendar and announcements Link to this post

    Hello guys,

    I have created my own descendant of the EventCalendar, as it is described in the exdenting recipe. Now I have the problem, that I'd like to have my created DateTime class also for the announcement. Is this possible?

    TIA
    Markus Alexander

  • UncleCheese
    Avatar
    4085 Posts

    Re: EventCalendar and announcements Link to this post

    Yes. You can use the extendAnnouncement() function in your custom DateTime class. Just add your fields to the $db array like normal, then write the function:

    public function extendAnnouncement()
    {
    $this->addAnnouncementField(new TextField('Foo'));
    // etc...

    }

  • alexanm
    Avatar
    Community Member
    38 Posts

    Re: EventCalendar and announcements Link to this post

    Hello Uncle Cheese,

    thank you for your answer, this works perfect. Ma next Problem ist that I have subclassed the CalendarDateTime class, in order to get my own fields in there. This CalendarDateTime class also has a Category field, which I would like to have in the filter. So I have added the field to the filter in the Holder class:

    $fields->addFilterField(new DropdownField('LineDanceDateTime_Category', 'Kategorie', singleton('LineDanceDateTime')->dbObject('Category')->enumValues()));

    The filter now shows up correctly, but the problem is when I apply the filter, the resulting sql command tries to load from the table LineDanceDateTime_Live and this does not exist.

    Any ideas?

    And last but not least: Is it possible to get a detail page for announcements too? The Problem ist, that I think its really unhandy to create an event for each appointment I have. I think these are only good for recurring events. But I have about 10 to 20 "announcements" per month, which only need a start date and an end date. But I'd really like to have a detail page....
    Is this possible somehow?

    TIA
    Markus Alexander

  • UncleCheese
    Avatar
    4085 Posts

    Re: EventCalendar and announcements Link to this post

    The CalendarDateTime class does not have a Category field. I'm not sure where you're seeing that. All you should need is

    $fields->addFilterField(new DropdownField('Category', 'Kategorie', singleton('LineDanceDateTime')->dbObject('Category')->enumValues()));

    As for the announcements, they were created because a lot of people said it was unnecessary to have a page for every event, and it would be nice to have both options. So to now give announcements a detail page seems a little counter-intuitive, but I suppose it could be done.

  • alexanm
    Avatar
    Community Member
    38 Posts

    Re: EventCalendar and announcements Link to this post

    Hello Uncle Cheese,

    sorry that was a typo: I have created the category field on my descendant 'LineDanceDateTime'. I have added the filter field as described below, but the resulting sql command tries to filter on the table 'LineDanceDateTime_Live' but this table does not exist, as the CalendarDateTime is descending from DataObject and not SiteTree...

    Regarding the detail page: The main thing I'd like to have a detail page for the Announcements is, that I'll provide each event with geo coordinates, and would like to show a map of the destination on the detail page.

    But I think I can also create the events as well.

    Thanks
    Markus Alexander

  • UncleCheese
    Avatar
    4085 Posts

    Re: EventCalendar and announcements Link to this post

    Interesting. It seems there is a flaw in the filtering mechanism for the Calendar in that it isn't built to handle custom filtering for a DateTime object -- only Events. I'll put that on my list for today.

  • alexanm
    Avatar
    Community Member
    38 Posts

    Re: EventCalendar and announcements Link to this post

    Hello Uncle Cheese,

    thanks for your fast replies.

    Two more questions: Is the newest version of your module also compatible with silverstripe 2.3.1? I tried to migrate my test enviroment to version 2.3.2 yesterday, but that didn't really work...

    Is there already an additional support for international Date and Time Formats? Because I had to change several things in your module in order to be able to get german month names and so on...

    Thanks
    Markus Alexander

  • UncleCheese
    Avatar
    4085 Posts

    Re: EventCalendar and announcements Link to this post

    No. I believe 2.3.2 is required.

    We've added a great date templating system to support any date format. You should not be altering the code. Have a look in your event_calendar/_config.php. Also, by default, the module will fall back on the date formatting specified in your lang file. I believe we have one set up for de_DE.

    4658 Views
Page: 1 2 3 4 5
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.