While working through tutorial 2 I was able to add the Date and Author the the main tab in ArticlePage and get it to show up in the tab itself. But when I create the news story and save or publish, the data for the added fields Date and Author did not save properly though the rest of the content did.
My ArticalePage.php:
<?php
/**
* Defines the ArticlePage page type
*/
class ArticlePage extends Page {
static $db = array(
'Date' => 'Date',
'Author' => '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');
return $fields;
}
}
class ArticlePage_Controller extends Page_Controller {
}
?>
I'm doing this in my site and this file lives in mysite/code directory.
Is there something small / obvious that I'm missing? The best I can tell my code is basically verbatim from the tutorial.
Cheers,
Craig