Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » LeftAndMain: The UncleCheese Blog

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3
Go to End
Author Topic: 2330 Views
  • Stefdv
    Avatar
    Community Member
    110 Posts

    Re: LeftAndMain: The UncleCheese Blog Link to this post

    UC,

    I have a new challenge...

    After upgrading to SS 2.4.3 everything seemed okay, i did nt have the HTTP Error anymore, but ...

    I also have some ImageUploadFields, the strange thing is that they are working if i use ModelAdmin, but if i manage my objects in the Page i only get a textfield showing the Image ID. No Uploadify what so ever. I had to change the parameters in my ImageUploadField from

    <CODE>          new ImageUploadField('Photo', 'Foto',Null,Null,Null,'SomeImagePage/Images') </CODE>

    To

    <CODE> new ImageUploadField('Photo', 'Foto') </CODE>

    Because i got an error concerning Uploadify when i tried to open my (Object)page for editing.

  • UncleCheese
    Avatar
    4085 Posts

    Re: LeftAndMain: The UncleCheese Blog Link to this post

    This looks like too many parameters for an UploadifyField:

    new ImageUploadField('Photo', 'Foto',Null,Null,Null,'SomeImagePage/Images')

    To set the upload folder, just use $your_uploadify_field->setUploadFolder('SomeImagePage/Images');

    ---------------
    Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

  • Stefdv
    Avatar
    Community Member
    110 Posts

    Re: LeftAndMain: The UncleCheese Blog Link to this post

    Okay UncleCheese,

    Got that.

    But what about the thing that i can not use the uploadify field in my page but can use it in ModelAdmin?

    [EDIT]

    In fact the Uploadify field is working when i ad a new Object ( A Serie in my case), but it doesn t show when i want to edit an existing Serie. Then it only shows an textfield with the Series ID.

    [/EDIT]

    [EDIT 2]

    This might help...If i edit an Object, the popup opens and the imagefield shows only the image ID. When i click on {Next} the Uploadify box shows, then when i click {Previous} the box shows where it first only showed a textfield. So it seems that it is some kind of refresh...but then again ... What do i know LOL

    ps. The same *.php files works in SS 2.4.2 but then i have HTTP errors in FileUploadFields ( posted that somewhere else)

    [/EDIT 2]

    <CODE>
    public function getCMSFields()
       {
          $fields = parent::getCMSFields();
          return new FieldSet
          (
             new TextField('SerieName'),
             new TextField('Genre'),
             new TextareaField('Beschrijving'),
             new TextField('Server'),
             new TextField('Folder'),
             new ImageUploadField('Cover'),
             new DataObjectManager
                (
                   $this,
                   'SerieSeasons',
                   'SerieSeason',
                   array('SeasonNmbr' => 'Seizoen')));

       }
    </CODE>

    Tx again

    2330 Views
Page: 1 2 3
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.