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... ???
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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.
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... ???
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);
}
that's cool!
but where do i have to put this function, and where do i call it?
thanks!
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.
thanks, it works... :)