10376 Posts in 2191 Topics by 1708 members
|Go to End||Next >|
6 July 2009 at 3:40am
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?
6 July 2009 at 11:54am
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()
6 July 2009 at 11:42pm Last edited: 7 July 2009 1:16am
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.
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?
7 July 2009 at 1:40am
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.
7 July 2009 at 1:45am
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.
7 July 2009 at 1:56am
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.
7 July 2009 at 2:07am
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...
7 July 2009 at 2:35am
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.
|Go to Top||Next >|