I have multiple event calendars on my site. One calendar for the main organization and multiple calendars for member organizations.
All of that works great if I only access the events from the calendar page for each respective member organization, but I'd like to display a "teaser" on other pages of the site. E.g on a member home page, I'd like to display the current event for that member.
My problem is, accessing only that member's data. Currently I'm doing something like this:
// current member organization event
function memberEvent($num=2) {
return DataObject::get("CalendarEvent", "ParentID = 27", "ID DESC", "", $num);
}
The problem is that I can't know the ID of the next member *until* that member created a calendar. this obviously requires a programmer to fix, but I'm trying to make it possible that they can create a calendar without having to call the programmer.
I'm not opposed to doing it this way(it is reasonable), but is there another way of doing this that I'm just simply not thinking about?
Any suggestions are greatly appreciated.
Thanks!
Chris.b