Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event Calendar - feature request.


Go to End


8 Posts   2440 Views

Avatar
hermes369

Community Member, 1 Post

9 February 2011 at 5:54am

I've read elsewhere that the Live Calendar widget (which I can't seem to find), provides a highlight on dates with events. I'm hoping someone smarter than me will add this functionality to Event Calendar. Also, I'm wondering if anyone has tested this module with the latest version of jQuery?

Thank you!

Avatar
UncleCheese

Forum Moderator, 4102 Posts

9 February 2011 at 6:26am

$LiveCalendarWidget isn't doing that for you? Should be.

Avatar
smallstudio

Community Member, 7 Posts

9 February 2011 at 11:55pm

On a slightly related note, I'm wanting to list events in the live calendar widget in any day table cell where there are events, and link to each of the event pages. I was hoping that there were some built-in controls like

<% if HasEvent %>
<% control Events %>
$Event.Title

etc

Any hints?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

10 February 2011 at 4:47am

There's a hack for that.. I haven't put it in the core because it adds a lot of database overhead to your page, but here you go:

On line 206 in CalendarUI.class.php, there's an array that accepts all the data for a given day in the calendar. You'll see that "HasEvent" is one field. After that entry in the array, add:

'Events' => $this->calendar->Events(null, $this->date_counter->date(), $this->date_counter->date()),

And on LiveCalendarWidget.ss:

<td class="$Today $OutOfMonth $CurrentDay $HasEvent">
<a href="$ShowDayLink">$Number</a>
<% if Events %><% control Events %><a href="$Event.Link">$Event.Title</a><% end_control %><% end_if %>
</td>

Avatar
smallstudio

Community Member, 7 Posts

10 February 2011 at 11:56am

Thank UncleCheese - That's exactly what I was after!

Avatar
smallstudio

Community Member, 7 Posts

10 February 2011 at 5:42pm

I ended up using this to display icons for each event on any given day with events. On rollover more details appear via a little javascript. I had to do another hack to CalendarUI.class.php to make the page reload (so the hidden divs would load) when using the next and previous month buttons in the widget:

'PrevMonthLink' => $this->calendar->Link('view')."/".$this->start_date->subtractMonth()->format('Y-m'),
'NextMonthLink' => $this->calendar->Link('view')."/".$this->start_date->addMonth(2)->format('Y-m'),

Just in case anyone wanted to do something like the attached.

Attached Files
Avatar
web2works

Community Member, 50 Posts

13 April 2011 at 10:22pm

Thank you unclecheese, silverstirpe would not be the same without.

Avatar
Noki

Community Member, 6 Posts

12 March 2012 at 12:11pm

I'm doing a similar thing with the event_calendar as smallstudio did and I changed the CalendarUi.class.php as followed

'PrevMonthLink' => $this->calendar->Link('view')."/".$this->start_date->subtractMonth()->format('Y-m'),
'NextMonthLink' => $this->calendar->Link('view')."/".$this->start_date->addMonth(2)->format('Y-m'),

If i now use the link the following Message will show up:

Fatal error: Call to a member function get() on a non-object in [...]/event_calendar/code/CalendarUI.class.php on line 204

if i open the link in a new window, everything works fine.
Does anybody has a clue, whats going on here?

Thanks for help