I'm creating a module to handle employee information. When I create a 'jobDescription' field in my staffPage.php, it creates a jobDescriptionID field in the database and, of course, doesn't save my text value.
The code for the staffPage.php is:
<?php
class StaffPage extends Page {
static $db = array(
);
static $has_one = array(
'jobDescription' => 'Text',
'colorPhoto' => 'File',
'bwPhoto' => 'File'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new TextField('jobDescription', 'Job description'), 'Content');
$fields->addFieldToTab("Root.Content.Main", new FileIFrameField('colorPhoto', 'Color photo'), 'Content');
$fields->addFieldToTab("Root.Content.Main", new FileIFrameField('bwPhoto', 'Black & white photo'), 'Content');
$fields->renameField("Title", "Name");
$fields->renameField("Content", "Bio");
return $fields;
}
}
class StaffPage_Controller extends Page_Controller {
}
?>
I'm using 2.30rc3.
Thanks in advance, Rick