Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » calendar widget

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1077 Views
  • marcink
    Avatar
    Community Member
    89 Posts

    calendar widget Link to this post

    hi,

    would it be possible to to extract the calendar into an widget? then you could have it on any pages, and when the user clicks on a date, he would be redirected to the calendar page... ???

  • UncleCheese
    Avatar
    4085 Posts

    Re: calendar widget Link to this post

    It already is.

    function GlobalCalendarWidget()
    {
    $calendarPage = DataObject::get_one("Calendar"); // If you have multiple calendars, specify an id or url segment.
    return new CalendarWidget($calendarPage);
    }

  • marcink
    Avatar
    Community Member
    89 Posts

    Re: calendar widget Link to this post

    that's cool!
    but where do i have to put this function, and where do i call it?

    thanks!

  • UncleCheese
    Avatar
    4085 Posts

    Re: calendar widget Link to this post

    If you want it on every page, the Page_Controller would probably be a good place since all your page types descend from that. It can be called on the template just like any other function.

  • marcink
    Avatar
    Community Member
    89 Posts

    Re: calendar widget Link to this post

    thanks, it works...

    1077 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.