21278 Posts in 5728 Topics by 2599 members
|Go to End||Next >|
19 August 2009 at 9:42pm
any info on why it didn't make it into 2.3.3 or how we can make it work in 2.3.3? which files to patch / replace?
20 August 2009 at 9:11am
Sounds like the fix will be included in 2.4.0.
I have asked for a patch from Silverstripe as this is something we really need to work. Will let you know once I hear from them.
15 January 2010 at 4:23am
Hi, if you have a look at the changelog from 2.3.4 you will not find the bugfix for the image-upload-folder-problem. Could anybody publish the bugfix for those who need it importantly?
21 April 2010 at 2:24am
In 2.4 , this problem has been fixed.
BUT, it would be _really_ nice if you could tell the image-field "from the file store" dropdown to go to a specific folder as well.. (usecase : client uploads a shitload of assets by FTP , reloads the assets , and needs to link those images to dataobjects or pages)..
Is this possible ?
23 April 2010 at 9:34am Last edited: 23 April 2010 9:36am
I actually had a play around with this and have a slightly hacked custom field working with this option. Basically there is no way to do this with the standard file fields, however the treeDropdownField which is used to select the folder does have a argument to define the starting ID for the tree, so basically I have created a custom field with a 7th argument which is the name of the folder you want to start with. However, it does mean that you can't make your way back above this folder, so it's not particularly flexible, though that could be a good thing depending on the use case.
Anyway here is the code for the CustomFileField: http://pastie.org/930505
To use it simply supply the folder you want to set as the selected one as the final argument like so:
new CustomFileField('FieldName', 'Title', Null, Null, Null, 'UploadFolder', 'SelectedFolder');
Note, if the folder does not exist it will default to root.
Also I did this pretty quickly so it might not be totally sound, and have only tested this on 2.4 RC1.
Let me know if works for you
www.SSBits.com - SilverStripe tutorials, tips and other bits
23 April 2010 at 8:50pm
Thanks a bundle !! I'll play around with this over the next weekend !!!
I think this would be a very nice addition to the core CMS , no ?
|Go to Top||Next >|