17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 4410 Views |
-
new ImageField('Banner_Image') point to another directory in the Assets Folder

3 May 2008 at 6:25am
Hi Everybody!!!
On to a new project, so more questions!
I wish to upload banners via the ImageField('Image') class to a directory that I define, like ../assets/Uploads/Banners
How do I do this?
Thanks,
Todd
-
Re: new ImageField('Banner_Image') point to another directory in the Assets Folder

27 May 2008 at 5:28am
According to the PHP IDE "Zend", ImageField has the following constructor arguments:
new ImageField(
string $name
string $title=null
int $value=null
Form $form=null
string $rightTitle=null
string $folderName='Upload'
);
Curiously enough, when I'm trying to fill out all of these fields, Zend's tooltip indicates that $form is being skipped.Anyway, I've tried to manually set $folderName with 6 and 5 constructor arguments, and neither methodes help me to upload images to an alternative directory.
I'd be thankfull for any info about this.
-
Re: new ImageField('Banner_Image') point to another directory in the Assets Folder

2 July 2008 at 12:16am
It would be great if someone, anyone had some sort of answer to this question. Maybe it is an issue that isn't too important to others, but it would be very helpful to me.
Todd
-
Re: new ImageField('Banner_Image') point to another directory in the Assets Folder

2 July 2008 at 11:52am
It seems to work for me. For one of my sites ive got "BlogImages" saving into blogimages/ folder
new ImageField("BlogImage", "Image", null,null, null, "blogimages");
-
Re: new ImageField('Banner_Image') point to another directory in the Assets Folder

5 July 2008 at 6:43pm
Hi Willr,
What version of Silverstripe are you using? I've tried the same thing in v. 2.2 and all it does is upload the image to the "Uploads" directory.
Todd
-
Re: new ImageField('Banner_Image') point to another directory in the Assets Folder

5 July 2008 at 9:38pm
this is on my site running tags 2.2.1 - http://open.silverstripe.com/browser/modules/sapphire/tags/2.2.1, have to upgrade to the latest some day
I have no clue why it would be broken on 2.2.2 You might just need to Debug through FileField.php - The constructor for ImageField should set the folderName. Perhaps theres a bug in that. I'll have I look into this on a upcoming project.
-
Re: new ImageField('Banner_Image') point to another directory in the Assets Folder

6 July 2008 at 2:55am
Hi Willr,
Is there a link where I can download 2.21?
Todd
-
Re: new ImageField('Banner_Image') point to another directory in the Assets Folder

6 July 2008 at 12:48pm
There might be a 2.2.1 zip on this site still (find the download link for 2.2.2 and change the URL to 2.2.1 and see if that works) Otherwise you will have to use subversion to checkout http://svn.silverstripe.com/silverstripe/open/modules/sapphire/tags/2.2.1
| 4410 Views | ||
| Go to Top | Next > |



