When I was using version 2.3.8, I created a News & Events holder and page type using the silverstripe tutorial #2, but I've since upgraded to version 2.4.2, and the page type doesn't work anymore (althought the holder does) - I'm sure it's a simple change of the code but I don't know what to change. Can someone identify what I need to change in the NewsEventsPage.php code below to make it compatible with v2.4.2? Thank you.
<?php
/**
* Defines the NewsEventsPage page type
*/
class NewsEventsPage extends Page {
static $db = array(
'Date' => 'Date',
'Author' => 'Text',
'NewsFooter' => 'Text'
);
static $has_one = array(
);
static $icon = "themes/easternpublic/treeicons/news";
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new CalendarDateField('Date'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('Author'), 'Content');
$fields->addFieldToTab('Root.Content.Main', new TextField('NewsFooter'),'Content');
return $fields;
}
}
class NewsEventsPage_Controller extends Page_Controller {
}
?>