Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar - feature request.

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1317 Views
  • hermes369
    Avatar
    Community Member
    1 Post

    Event Calendar - feature request. Link to this post

    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!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar - feature request. Link to this post

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

  • smallstudio
    Avatar
    Community Member
    7 Posts

    Re: Event Calendar - feature request. Link to this post

    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?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar - feature request. Link to this post

    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>

  • smallstudio
    Avatar
    Community Member
    7 Posts

    Re: Event Calendar - feature request. Link to this post

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

  • smallstudio
    Avatar
    Community Member
    7 Posts

    Re: Event Calendar - feature request. Link to this post

    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
  • web2works
    Avatar
    Community Member
    50 Posts

    Re: Event Calendar - feature request. Link to this post

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

  • Noki
    Avatar
    Community Member
    6 Posts

    Re: Event Calendar - feature request. Link to this post

    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

    1317 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.