Hi,
I extended the backend with a new Main.Teaser tab and created an ImageField, two TextFields and and a SiteTree DropDown. Perfectly working are the Image and the DropDown. The TextFields are shown, but the data cannot be saved, that means, you can write text in it, can save the site, get a positive feedback "Your site has been saved.", but when you reload the backend site, the information is gone... Strange, isn't it?
Here is my code:
class TeaserContentCombo extends Page {
static $db = array();
static $has_one = array(
'TeaserPhoto' => 'Image',
'TeaserTitle' => 'Text',
'TeaserContent' => 'Text',
'TeaserTarget' => 'SiteTree'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldsToTab(
"Root.Content.Teaser",
array(
new ImageField('TeaserPhoto'),
new TextField('TeaserTitle'),
new TextField('TeaserContent'),
new TreeDropdownField("TeaserTargetID", "Choose a site to be forwarded to:", "SiteTree")
)
);
return $fields;
}
}
class TeaserContentCombo_Controller extends Page_Controller {
}
Thanks a ton for every help in advance!
Cheers, Mario