Hi,
Having a small problem here with a data object, just can't see the problem, maybe someone can spot it.
Basically I have a data object that I am trying to use in my homepage, but when I click on my tab I am getting no form field as you will see in the attached image.
This is the code in my homepage:
class elevatorHomePage extends Page {
static $db = array();
static $has_one = array(
'myAboutPage' => 'AboutPage'
);
static $icon = "themes/elevator/images/treeicons/home";
static $allowed_children = array('AboutPage', 'VacanciesPage');
function getCMSFields() {
$fields = parent::getCMSFields();
$tableField = new ComplexTableField(
$this,
'myAboutPage',
'AboutPage',
array(
'AboutContent' => 'About'
),
'getCustomCMSFields'
);
$tableField->setParentClass('elevatorHomePage');
$fields->addFieldToTab('Root.Content.About', new HtmlEditorField('About'), $tableField);
return $fields;
}
}
and this is the corresponding data object:
class AboutPage extends DataObject {
static $db = array(
'AboutContent' => 'Text',
);
static $has_one = array(
'elevatorHomePages' => 'elevatorHomePage'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.About', new HtmlEditorField('About'), 'AboutContent');
return $fields;
}
}