10382 Posts in 2196 Topics by 1711 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 805 Views |
-
Bring event details into LiveCalendarEvent widget

14 April 2010 at 3:34am
Hi
I am customising the LiveCalendarEvent widget so that when a user clicks on a valid date a lightwindow appears showing the event title and description.I am also only using the "Announcements" part of the Events Calendar module, as this suits the site better.
What I need to know is how I pull in the announcement title and announcement content into the widget?
Thanks
Samuel -
Re: Bring event details into LiveCalendarEvent widget

14 April 2010 at 5:02am
Tricky. Here's the problem. The calendar is setup to accept multiple events on a given day. As such, the LiveCalendarWidget is not technically "event aware" in the sense that you could pull an associated event from a specific day. All it knows is that it has at least one event, and the click takes you to the calendar view for that day, which again, may contain one or 100 events.
Your model is asking the calendar to assume that there is only one event per day, as I understand it.
It would take some clever re-engineering. Not hacking, but subclassing and template overrides. Should be relatively easy if you're good with code.
Start by subclassing LiveCalendarWidget, and overload the getWeeks() method.
$weeks = parent::getWeeks();
foreach($weeks->Days as $d) {
$date = $this->start_date->format('Y') . "-" . $this->start_date->format('m') . "-" . $d->Number;
$d->Event = DataObject::get_one("CalendarDateTime", "StartDate = '$date'");
}Then, override the template in your theme dir, and in the <% control Days %> function, you should be able to get to the associated event with $Event.
You'll need to run an update because none of the LiveCalendarWidget vars are subclassable right now, and I just changed that.
-
Re: Bring event details into LiveCalendarEvent widget

14 April 2010 at 5:34am
Hi UncleCheese and thank you for your reply.
Would it make it any easier to show all events in the pop-up, thus allowing for multiple events on one day.For example, the output would be:
DATE
Title
DescriptionTitle
Descriptionetc...
Thanks in advance
-
Re: Bring event details into LiveCalendarEvent widget

6 August 2010 at 9:31am
Hey Sca,
Did you ever get any further with this stuff? I too was looking at customizing the widget to be more similar to a google calendar. Larger, displaying event info in a days given box, etc. . . -
Re: Bring event details into LiveCalendarEvent widget

17 August 2010 at 8:39am
Could you expand or spell this out a little more for me please. I'm still having a hard time bringing info into the widget. Thanks.
| 805 Views | ||
|
Page:
1
|
Go to Top |


