Does anyone know how to replicate ImageDataObjectManager behaviour in SS3? I'm referring to the ability to have a class such as this:
class PhotoGalleryImage extends DataObject
{
static $db = array (
'Caption' => 'Text'
);
static $has_one = array (
'Image' => 'Image',
'PhotoGalleryPage' => 'PhotoGalleryPage'
);
}
Where the focus of the object is on the image relationship, and easily import a bunch of photos at once in to a page like this:
class PhotoGalleryPage extends Page {
static $has_many = array (
'PhotoGalleryImages' => 'PhotoGalleryImage'
);
public function getCMSFields() {
$fields = parent::getCMSFields();
//What to put here??
return $fields;
}
}
Then add captions etc. if necessary afterwards. I tried using GridField but the best I could get to happen is to create one PhotoGalleryImage object at a time - which then has to be saved before adding an image to it. Very time consuming compared to the old way of doing it with ImageDOM and Uploadify!
Thanks for reading