Hi,
I have extended the Image class to add some utility functions to generate thumbnails. However it seems that when attaching images to the DataObject this image belongs to, I cannot see any images added via the CMS File manager. Only the images added via the UploadField of this custom Image type are visible. Is this normal?
Custom Image:
<?php
class CustomImage extends Image {
function generatePhotoThumb($gd){
return $gd->croppedResize(196,187);
}
}
DataObject it belongs to:
class MyDataObject extends DataObject
{
static $has_one = array (
'MyCustomImage' => 'CustomImage',
'NormalImage' => 'Image'
);
public function getCMSFields()
{
return new FieldList(
new UploadField('MyCustomImage', 'Custom Image'),
new UploadField('NormalImage', 'Normal')
);
}
}
The UploadField for NormalImage displays all the files in the Assets folder. However, the UploadField for MyCustomImage only displays images that were uploaded via the UploadField.
Is this normal behaviour?
Thanks.
VWD.