Jump to:

10929 Posts in 2613 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar: New Feature

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 2882 Views
  • UncleCheese
    Avatar
    4085 Posts

    Event Calendar: New Feature Link to this post

    Revision 74 of Event Calendar introduces a new UI feature:

    LiveCalendarWidget

    This is an AJAX-based counterpart to CalendarWidget that is event-aware and will mark dates that have events. Further, because it is AJAX based and not generated completely client side, it adheres to MVC, making it easy to extend and customize. To change the look and feel, simply create your own LiveCalendarWidget.ss in your mysite/templates directory, or simply create an extension to LiveCalendarWidget.css for simpler modifications.

    This revision has also deploys some handy new functions through a new SiteTree decorator, making calendars easier to syndicate with much less coding.

    On any page, you can now use:

    <% control UpcomingEvents(count,calendar-url-segment) %>

    <% control RecentEvents(count,calendar-url-segment) %>

    $CalendarWidget(calendar-url-segment)

    $LiveCalendarWidget(calendar-url-segment) %>

    Note that if no url segment is given, the controller will assume there is only one Calendar in the site tree and get an instance of it. In other words, unless you have multiple calendars on your web site, you can use $CalendarWidget, <% control UpcomingEvents %>, etc.

    Also note that "count" defaults to 5.

    Lastly, a date string can be given to $CalendarWidget and $LiveCalendarWidget to override the default start date, for example:

    $LiveCalendarWidget(calendar-url-segment,20090801)

  • cpxksr
    Avatar
    Community Member
    5 Posts

    Re: Event Calendar: New Feature Link to this post

    Hi UncleCheese and thanks so much for developing this awesome module.

    I've set it up and all looks good, except for when I add a new Calendar Event.

    I can set the name etc on the Event but when I select the dates tab and want to add a new date, the date picker doesn't show up and I can't type into the box :-/

    I've tried this in FF 3.5, Chrome and IE7

    thanks!
    cpxksr

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar: New Feature Link to this post

    I'm not too sure what you mean by the first question. You'll have to give me a better example.

    For your second question, there are three criteria for finding an event within a date range:

                (StartDate <= '$start' AND EndDate >= '$end') OR
                (StartDate BETWEEN '$start' AND '$end') OR
                (EndDate BETWEEN '$start' AND '$end')

    So I would think your event would catch the third filter, having an end date between Sept 1 and Sept 30.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar: New Feature Link to this post

    In Silverstripe, you're always able to call a controller from the URL, as far as I know. It's better practice to declare a $url_segment variable in your controller to make this a little more secure, though. If you use the $allowed_actions array, you can limit which functions can be run from the URL, as well, so it's pretty secure.

    Just checked in that change to give Announcements the same criteria. Want to test it?

  • cpxksr
    Avatar
    Community Member
    5 Posts

    Re: Event Calendar: New Feature Link to this post

    Is this the wrong thread to post problems with the module?

    br,
    cpxksr

  • karibe
    Avatar
    Community Member
    56 Posts

    Re: Event Calendar: New Feature Link to this post

    How can I localize $LiveCalendarWidget, this is what I'm looking for my home page but I have to translate some elements into polish.
    I see some mnemonics like

    <optgroup label="<% _t('LiveCalendarWidget.JUMPTOMONTH','Jump to...') %>" />

    but translating it in event_calendar/lang/pl_PL.php
    or mysite/lang/pl_PL.php has no effect. I did translation with CalendarWidget by changing into $lang['pl_PL']['CalendarWidget']['LOCALEFILE'] = 'date_pl.js'; but habe no idea how to do that with Live widget

  • karibe
    Avatar
    Community Member
    56 Posts

    Re: Event Calendar: New Feature Link to this post

    No one knows ?

  • karibe
    Avatar
    Community Member
    56 Posts

    Re: Event Calendar: New Feature Link to this post

    Ok as I see mnemonics are used from event_calendar/lang but only from en_US.php.
    All other page elements are properly translated to polish language but $LiveCalendarWidget is not reacting.

    I'm setting language in Page_Controller init method like this:

          if($this->dataRecord->hasExtension('Translatable'))
          {
             if ( ereg("^".Translatable::default_lang(), $_SERVER['HTTP_ACCEPT_LANGUAGE']) )
             {
                i18n::set_locale(Translatable::default_locale());
             }
             else
             {
                Translatable::set_current_locale("en_US");
                i18n::set_locale("en_US");
             }
          }

    2882 Views
Page: 1 2
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.