Hi all,
I've only started developing with Silverstripe a short while ago and got some questions. I want to include a list of upcoming events from a Google Calendar. I started by making a widget because I found the "how to make your own widget" tutorial. Now that I'm done, and the widget is working, I think it is not exactly what I need :-)
The list of events should be on every page, or at least at almost every page. Using a widget doesn't seem natural because one has to use the widget-tab to add it to each page.
Then I thought I could just add a method to the Page class using this piece of code:
class Page_Controller extends ContentController {
...
function Events() {
$oGCalendarWidget = new GCalendarWidget();
return $oGCalendarWidget->Events();
}
...
}
From what I understood this would make it accessible in the templates using <% control Events %>, but I don't get any results. Is this the correct way to do this kind of stuff?
Cheers,
Barry