Hi,
I am trying to display a list of upcoming events and announcements on a homepage. I can display all events and announcements for multiple calendars by using the rss feed option combo. But I do not want to do that as I would like to list each calendars title and then a list underneath.
eg
Seniors events (cal name)
- event 1
- announce 1
- event 2
- announce 2
Masters events (cal name)
- event 1
- announce 1
- event 2
- announce 2
I have the following functions in my homepage controller
public function SeniorEvents() {
$where = "ParentID = 23";
return DataObject::get_one("Calendar")->upcomingEvents(10, $where);
}
public function AllCalendars() {
return DataObject::get('Calendar');
}
The last method lists each calendar but I cant get the events and I get an error if i try to call the upcoming events on the datalist..
The first function always pulls the data from the first calendar it comes across even if i use the filter clause.
Here is the where clause WHERE ("Recursion" = '1') AND ("ParentID" = '24') AND (ParentID = 23) AND ("SiteTree_Live"."ClassName" IN ('CalendarEvent')) ORDER BY "SiteTree_Live"."Sort" ASC,256) Calendar id 24 is always in the clause. If I use the template to pass the url frag to the function this does not appear to do anything..
If anyone can help me I appreciate it..
Also one other thing there is an incomplete url formed with any announcements listed via the upcoming events method...
announcement url = http://localhost/site/?date=2013-01-05
event url = http://localhost/site/surf-sports/surf-boat-rowing/senior-calendar/event-name/
Many thanks in anticipation.. (Uncle Cheese...help please)
cheers Tim