22848 Posts in 9653 Topics by 2803 members
|Go to End|
13 June 2009 at 4:24am
I need to add an option on the silverstripe pages to upload an image thumbnail that is set to a preset size, is there anyway of doing this?
13 June 2009 at 9:14am
Does it need to be saved as a certain size or just displayed as a certain size after it has been uploaded?
13 June 2009 at 10:31am
When using SilverStripe you usually upload an image in its original format and then define in the template what size it should have. The resized version of the image (in other words: thumbnail) will automatically be created and cached for you.
If you want to make sure, that the users only upload images of a given size, you could probably achieve that by subclassing the ImageUpload field or create custom validators. But as mentioned previously, this procedure isn't really necessary for most use-cases.
13 June 2009 at 9:04pm
Thanks for the reply's, yes, the thumbnails need to be a certain size to fit the template without being shrunk so they distort. The users do not really understand how to make the images smaller so would be good if on the page they edit there was a browse button and then they click and upload an image for that page. I need to access the image upload and edit tools but from within the page screen so the image can be edited easily.
14 June 2009 at 1:32am
This tutorial will be useful for you :
15 June 2009 at 10:26pm
Cheers that was what I was looking for
|Go to Top|