Jump to:

23450 Posts in 18899 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » upload image as thumbnail

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

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

Page: 1
Go to End
Author Topic: 1307 Views
  • cbartgu
    Avatar
    Community Member
    12 Posts

    upload image as thumbnail Link to this post

    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?

  • Howard
    Avatar
    Community Member
    215 Posts

    Re: upload image as thumbnail Link to this post

    Does it need to be saved as a certain size or just displayed as a certain size after it has been uploaded?

  • banal
    Avatar
    Community Member
    901 Posts

    Re: upload image as thumbnail Link to this post

    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.

  • cbartgu
    Avatar
    Community Member
    12 Posts

    Re: upload image as thumbnail Link to this post

    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.

  • sorich87
    Avatar
    Community Member
    14 Posts

    Re: upload image as thumbnail Link to this post

    This tutorial will be useful for you :
    http://doc.silverstripe.com/doku.php?id=imageupload

  • cbartgu
    Avatar
    Community Member
    12 Posts

    Re: upload image as thumbnail Link to this post

    Cheers that was what I was looking for

    1307 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.