7919 Posts in 1358 Topics by 932 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » IDOM + uploadify: can't add existing files
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 276 Views |
-
IDOM + uploadify: can't add existing files

2 March 2012 at 1:42am Last edited: 2 March 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!
cheers
Max
-
Re: IDOM + uploadify: can't add existing files

2 March 2012 at 7:05am
well...
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: http://www.silverstripe.org/dataobjectmanager-module-forum/show/14593
so thanks
!
| 276 Views | ||
|
Page:
1
|
Go to Top |

