My BookingHolder extends Calendar, and BookingEvent extends CalendarEvent. I have also extend Page to create BookingPage, which I've allowed as a child of BookingHolder in order to display some static information pages.
What I'm trying to do is create two BookingHolders at the root level of my website tree. Using and adapted version of the event resources module every booking (event) is assigned a Resource (room event takes place in). As my understanding is that all event records are stored in the same table, what I've done is modified my templates so each of my two BookingHolder(s) only displays events assigned to a particular resource. So I effective have:
Now all of this works fine, with one exception, and that's the LiveCalendarWidget when used on my custom pages. I works fine when directly used via BookingHolder or Booking Event, but not my BookingPage. When used on BookingPage it DOES work for Calendar1/Page1, but when used on Calendar2/Page2 it's still linking to my Calendar1 URL. A Debug::dump($this->calendar); via CalendarUI.class shows:
[record:protected] => Array
[ClassName] => BookingHolder
[Created] => 2011-08-14 22:45:58
[LastEdited] => 2011-08-20 17:52:30
[URLSegment] => calendar1
[Title] => Calendar1
[MenuTitle] => Calendar1
As you can see the problems is that the URLSegment and other details are those for my Calendar1. I've actually swapped the order of the BookingHolders in the site tree to put Calendar2 before Calendar1 and the same thing happens. So basically the LiveCalendarWidget is always using details from the FIRST instance of CalendarHolder in the tree.
Can anyone help me with how i may work around this? Presumably I need to make some changes to public function __construct in LiveCalendarWidget, but I'm struggling to see how to change this. Anyone able to help?