Using the documentation in tutorial 2, I created a news section page type and holder. Worked great (in ss ver 2.3.7). Now that I've created a new site using 2.4.0 (upgrade would not work for numerous reasons, I'm sure), I have the site back and working except for the news section page types. The holder works fine, and I can open it and create a new one in the CMS, but if I click on one of the news pages, I get the red "error loading page". I also cannot create a new news page type. I am not a dangerously sharp object when it comes to figuring out why things aren't working - could anyone provide a hint? I would suppose that the code requirements may have changed from 2.3.7 to 2.4.0, but I don't know what it would be. Thanks in advance. Here is my code:
<?php
/**
* Defines the NewsEventsPage page type
*/
class NewsEventsPage extends Page {
static $db = array(
'Date' => 'Date',
'Author' => 'Text',
'NewsFooter' => 'Text'
);
static $has_one = array(
);
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 {
}
?>