21278 Posts in 5728 Topics by 2599 members
| Go to End | Next > | |
| Author | Topic: | 4581 Views |
-
Re: Cannot set custom folder for ImageField

19 August 2009 at 9:42pm
Hi blair,
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?
thanks,
wmk
-
Re: Cannot set custom folder for ImageField

20 August 2009 at 9:11am
Hi wmk,
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.
Blair.
-
Re: Cannot set custom folder for ImageField

8 January 2010 at 2:20pm
I wrote a SS2.3.x-module with a temporate fix that can be downloaded here.
Of course you have to do some rewriting as soon as you start updating your productionsites.
-
Re: Cannot set custom folder for ImageField

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?
Carsten...
-
Re: Cannot set custom folder for ImageField

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 ?
-
Re: Cannot set custom folder for ImageField

23 April 2010 at 9:34am Last edited: 23 April 2010 9:36am
Hi Fuzz10,
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
Aram
www.SSBits.com - SilverStripe tutorials, tips and other bits
-
Re: Cannot set custom folder for ImageField

23 April 2010 at 8:50pm
Aram,
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 ?
-
Re: Cannot set custom folder for ImageField

23 April 2010 at 9:49pm
Yea would definately be useful as a core feature and seems like all the basics are there to implement it, though not sure my code would be good enough! lol
Aram
www.SSBits.com - SilverStripe tutorials, tips and other bits.
| 4581 Views | ||
| Go to Top | Next > |




