21282 Posts in 5730 Topics by 2601 members
General Questions
SilverStripe Forums » General Questions » Overridden Image class DataObject member cannot see any images uploaded via CMS File Manager
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 76 Views |
-
Overridden Image class DataObject member cannot see any images uploaded via CMS File Manager

18 March 2013 at 5:42am Last edited: 18 March 2013 5:43am
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.
| 76 Views | ||
|
Page:
1
|
Go to Top |

