Hi,
I am trying to add a Logo image field to SiteCOnfig under SS 3.1. I first followed the instructions on extending SiteConfig at http://doc.silverstripe.org/framework/en/reference/siteconfig : everything went Ok.
I then changed the lines
private static $db = array(
'FooterContent' => 'HTMLText'
);
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab("Root.Main", new HTMLEditorField("FooterContent", "Footer Content"));
}
to
private static $has_one = array(
'LogoImage' => 'Image',
);
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab(
"Root.Main", new UploadField("LogoImage", "Choose an image for your site logo"));
}
but it doesn't work. I can select a file for download (no drag and drop area however), but on validating, the screen is not updated to reflect my choice, and while, on saving, a message tells me "saving is Ok, nothing at all is uploaded.
This worked perfectly in SS 3.05.
Thanks for help