Jump to:

1976 Posts in 1306 Topics by 607 members

Form Questions

SilverStripe Forums » Form Questions » UploadField Thumbnails and other issues SS3

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

Page: 1
Go to End
Author Topic: 351 Views
  • tazzydemon
    Avatar
    Community Member
    114 Posts

    UploadField Thumbnails and other issues SS3 Link to this post

    I have created an Orbit slider class to go with my foundation template. This class has some couple of small issues as detailed below:

    1. If I use the UploadField to choose an image "from files" the resulting popup is correct and in the correct directory but does not show the thumbnails that are available in the Files repository. What is the config to enable this - or is there on at all? Very hard to choose images if you cant see them.

    2. How do I disable the upload buttons when there is already one image. This is supposed to be automatic in a has_one and I have set allowedMaxFileNumber' => 1 to no avail.

    3. When I create a new Orbit image and choose an image "from files" it fails as there is no actual object to attach it to. I see there is a setRecord() method available but cant see how to use it. If I save the new, empty Orbit image before choosing a "from file" it works fine. Curiously, if I upload a fresh image to an unsaved new Orbit image this seem to happen automatically and it works fine.

    Any ideas appreciated.

  • tazzydemon
    Avatar
    Community Member
    114 Posts

    Re: UploadField Thumbnails and other issues SS3 Link to this post

    An addendum to my post..
    if I add

    $imageField->setRecord($this);

    Then I get "Files can be attached once you have saved the record for the first time." in the image upload field, which at least makes some sense. So I guess I have to save the record the instant its created.

    Ideas again..how?

    Oh and I know my hat looks stupid.. it was my daughter's wedding at Tekapo!

    351 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.