I've achieved something similar (without using a DataExtension) in 3.1, not sure if it'll work in 3.0:
<?php
class LogoImage extends Image {
private static $db = array(
'ExternalURL' => 'Text'
);
private static $belongs_many_many = array(
'Page' => 'Page'
);
/**
* @return FieldList
*/
public function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Main', new TextField('ExternalURL', 'URL'));
return $fields;
}
}
There were some changes to how the EditForm is built:
3.0: https://github.com/silverstripe/silverstripe-framework/blob/3.0/forms/UploadField.php#L842-L879
3.1: https://github.com/silverstripe/silverstripe-framework/blob/3.1/forms/UploadField.php#L1445-L1462
Hope this helps
Posted to: Add field to UploadField iframe | Show Thread | Post Reply