Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

IDOM + uploadify: can't add existing files

Go to End

2 Posts   837 Views


Community Member, 8 Posts

2 March 2012 at 1:42am

Edited: 02/03/2012 1:51am

Hello everyone,

i have a Pagetype "SlideshowPage" where multiple Images should be added.

Therefor i have a Class "SlideshowImage extends Image"
which has_one "SlideshowPage"
SlideshowPage $has_many "SlideshowImages" => "SlideshowImage".

On the Page i have a IDOM:

$manager = new ImageDataObjectManager($this, 'SlideshowImages', 'SlideshowImage');
 $fields->addFieldToTab('Root.Content.Main', $manager, 'Content');

Everything is working beautifully so far.
As long as i upload images directly from the SlideshowPage.

Now the Problem:

It seems to be impossible to add images previously uploaded via the Assetadmin.
(can see, them select them, continue but images are not attached. no ajax reponse erros, though)

Seems to me that this is because previously uploaded images have the ClassName "Image"
and Images uploaded via the IDOM are generated as "SlideshowImages"

Because when i change the className (of images added via AssetAdmin) manually in the "File" table, ("Image" to "SlideshowImage")
i can actually add them on the SlideshowPage via IDOM.

Is there any way to configure IDOM to add existing "Images" as "SlideshowImages" ?

Any help would be much appreciated!




Community Member, 8 Posts

2 March 2012 at 7:05am


here's the (kind of obvious) solution:

my custom image:

Class SlideshowImage extends DataObject{
$has_one = atrray( 'Image', 'Image');

my page holding the custom images

new ImageDataObjectManager($this, 'Images', 'LdGalleryImage', 'Image')

i think it's a bit tricky to understand not to extend Image directly (as Images extends File which extends DataObject)

but it's all already explained here:

so thanks :) !