I am trying to do something that seems fairly simple, but has hitched me up. I am trying to auto populate the "author" field with the current user name. I am using:
class NewsPage extends Page {
static $db = array(
'Date' => 'Date',
'Author' => 'Varchar'
);
static $has_one = array();
function getCMSFields() {
$member = Member::currentUser();
$f = parent::getCMSFields();
$f->addFieldToTab("Root.Content.Main", new TextField("Author", "Author", $member->FirstName));
return $f;
}
} I am not seeing anything show up in the field. I have also tried just dropping in a "test" into the value field with no luck.