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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

UploadField Thumbnails and other issues SS3


Go to End


2 Posts   943 Views

Avatar
tazzydemon

Community Member, 135 Posts

15 October 2012 at 1:54pm

I have already posted this to forms but no replies so maybe more luck here

I have created an Orbit slider class to go with my Zurb Foundation template (which I am planning to submit for public use). 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 image thumbnails that are available in the Files repository. What is the config to enable this - or is there one at all? It is very hard to choose images if you can't see them.

2. How do I disable the upload buttons when there is already one image selected. 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 and if I add

$imageField->setRecord($this);

In the getCMSFields() function then at least I get a warning to save the new object first. For the unwary though, the save button by default says "Create" whereas the warning text is by default "Files can be attached once you have saved the record for the first time." which will lead some users to quiz the operation. How might I save this object immediately it's instantiated.

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.

Avatar
suntrop

Community Member, 141 Posts

30 May 2013 at 4:20am

Hi!
Have you found a solution?

I wanted to have thumbnails in SS for 4 years now :-) Version 3 came with some sort of improvement, but it looks quite buggy :-(

I don't know why they don't care about this issue. You really can't select images without seeing them! Filenames are good unless you've got more than 10 images …