10448 Posts in 2223 Topics by 1719 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1027 Views |
-
eventCalender module: displaying events on a custom pagetype

23 July 2009 at 11:09pm
hi folks, especially uncle cheese,
today i've added the eventcalender on my site, works very fine!
now i'm wondering if there is a way to display a given number of most recent events on a non calender pagytype page, eg. the startpage?i hope there is?!
cheers, p.
-
Re: eventCalender module: displaying events on a custom pagetype

24 July 2009 at 1:14am
Yeah, this question comes up a lot. What I usually do is put this function in my Page_Controller class so I can use it on any pagetype.
function UpcomingEvents()
{
return DataObject::get_one("MyCalendarClass")->UpcomingEvents(5);
} -
Re: eventCalender module: displaying events on a custom pagetype

24 July 2009 at 1:33am
hi uc,
thanx 4 the fast reply - i'm gonna check this out 2night!
thanx
-
Re: eventCalender module: displaying events on a custom pagetype

24 July 2009 at 7:37am
How does one implement upcoming events for multiple calendars? I get terrible errors when I try to call return DataObject::get_one("Calendar")->upcomingEvents(5, "CalenderID = 31"); (using 31 as example). When I just leave it alone - all I get is events from the first calendar.
I have multiple calendars for different sports programs. (ie. Men's Basketball, Women's Basketball, Softball, etc.)
I would also (while I'm on the subject) like to modify the ICS feed function to cache the feed from a calDav server into the calendar database as announcements, to reduce load time and server strain when the calendar page is called. Any idea where I should begin?
-
Re: eventCalender module: displaying events on a custom pagetype

25 July 2009 at 8:32am
Are you using any recurring events or announcements? I that case it might be easier just to do DataObject::get("CalendarDateTime", null, "StartDate ASC");
Otherwise, you can get the DO sets for each calendar using UpcomingEvents, run a merge on them, then use CalendarUtil::date_sort() to get them all squared away before returning them to the template.
I'd love to find a way to cache those ICS feeds. It adds a lot of overhead. Let me know if you have any ideas.
-
Re: eventCalender module: displaying events on a custom pagetype

25 July 2009 at 8:39am
Edit:
Are you using any recurring events or announcements? I that case it might be easier just to do DataObject::get("CalendarDateTime", null, "StartDate ASC");
Should say "if that's NOT the case"
| 1027 Views | ||
|
Page:
1
|
Go to Top |

