Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » ModelAdmin, DOM and multiple uploads

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 424 Views
  • EDi
    Avatar
    Community Member
    5 Posts

    ModelAdmin, DOM and multiple uploads Link to this post

    Hello!

    I'm new to SilverStripe and have a problem I can't solve. I hope you can help me.

    I have a Gallery object (DataObject with Title and Author fields) with has_many relation to MyImage (Image object extended with Title and Caption fields). I'm using ModelAdmin to edit Galleries. After creating Gallery I have to add lots of MyImages to it. (I'm using Uploadify for the files.) The problem is SS asks me to enter Title and Caption for image, save the record and then add a single file at once.

    When there is a GalleryPage without adding images to Gallery object, Uploadify gives me the tool to upload as many images at once, as I need with no need to fill titles and captions (in some galleries I need them, but in biger ones I don't). Is it possible to get the same functionality in my Gallery form? And if not, maybe you can point me in the right direction to solve this task?

    I need to add every image to Gallery object. I need to upload tons of images. Sometimes I have to fill the Title and Caption for the image.

    Cheers!
    ED

  • danzzz
    Avatar
    Community Member
    175 Posts

    Re: ModelAdmin, DOM and multiple uploads Link to this post

    hi

    do you also have a relation in the MyImage class to? sampel of mine:

    class MyImage extends Image {

    static $has_one = array (
       'Produkt' => 'Produkt',
    );

    }

    parts of my Produkt.php

    class Produkt extends Page {
    ...

    static $has_many = array(
       'Produktbilder' => 'MyImage'
    );

    ...

    function getCMSFields() {

    ...

    $images = new MultipleImageUploadField('Produktbilder', 'Produktbilder');
    $images->removeFolderSelection();
    $images->imagesOnly();
    $images->uploadFolder = 'Uploads/Produktbilder';

    this is working for me and I can add multiple images at once ...

    best,

  • EDi
    Avatar
    Community Member
    5 Posts

    Re: ModelAdmin, DOM and multiple uploads Link to this post

    Yes, I have the relations. It is working with the Page object, but with DataObject does not.

    424 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.