Jump to:

11004 Posts in 2735 Topics by 1824 members

All other Modules

SilverStripe Forums » All other Modules » Preview: Event Calendar Module

Discuss all other Modules here.

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

Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Go to End
Author Topic: 41901 Views
  • Xeal
    Avatar
    Community Member
    37 Posts

    Re: Preview: Event Calendar Module Link to this post

    I've started playing around with SS recently, but I'll look into it and when I figure it out myself I'll let you know.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Did that latest revision work for you?

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: Preview: Event Calendar Module Link to this post


    function extendAnnouncement()
    {
    $this->removeAnnouncementField('Content');
    $this->addAnnouncementField(new SimpleHTMLEditorField('Content'));
    }

    Will not work: Announcement is a property of WorkshopHolder, not of Workshop (from Calendar/not from CalendarEvent)

    And there are other reasons to have seminars (we have 15-20 of them + 3-5 external, i.e. redirects) as WorkshopHolder and meetings as non-repeating events.

    So, my question is: How to create WorkshopAll page which had WorkshopHolder pages as children and was listing their events?

    Thanks

    Victor

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Of course it will work. The CalendarDateTime class has an abstract function extendAnnouncement() that you can use to add fields to the announcement popup. Did you try it? What error did you get? Be sure you're up to date on your SVN.

    To make a Seminar holder you could do something as simple as:

    class SeminarHolder extends Page
    {
    static $allowed_children = array('WorkshopHolder');
    }

    class SeminarHolder_Controller extends Page_Controller
    {
    }

    SeminarHolder.ss

    <% control Children %>
    $Title
    Upcoming Seminars
    <% control upcomingEvents(5) %>
    event info here
    <% end_control %>
    <% end_control %>

  • Victor
    Avatar
    Community Member
    128 Posts

    Re: Preview: Event Calendar Module Link to this post

    No, I want SeminarHolder behaved exactly as WorkshopHolder, but with a twist: it displays events associated with its children.

    So I took WorkshopHolder.php and copied it to SeminarHolder.php with obvious replacement

    Then I took WorkshopHolder.ss and copied it to SeminarHolder.ss and enveloped <% if Events %>....<% end_if %>:

    <% control children %><% if Events %>....<% end_if %><% end_control %>

    However CalendarWidget on this page does not filter.

    Victor

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    Right, because the start and end date parameters come in from the URL and that is parsed in the controller. Once you get into <% control Children %> you are not in the page controller anymore.

  • Xeal
    Avatar
    Community Member
    37 Posts

    Re: Preview: Event Calendar Module Link to this post

    Works perfectly for me now thanks!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: Event Calendar Module Link to this post

    I've checked in the patch for the "ghost dates" bug.

    41901 Views
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
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.