Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Files & Images + Thumbnails

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

Page: 1
Go to End
Author Topic: 1873 Views
  • shmk
    Avatar
    Community Member
    4 Posts

    Files & Images + Thumbnails Link to this post

    I'm using Files & Images to upload photos through the admin panel.

    Photos are uploaded "as is".

    Is it possible to have a thumbnail creation in the upload process? So there is the photo in a folder and his thumb in a subfolder.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Files & Images + Thumbnails Link to this post

    I wonder why you would need such a feature? Images are automatically being resized and cached upon request, so you can have as many different thumbnail sizes as you wish. They will be stored in the _resampled folder.

    Here's more information on this: http://doc.silverstripe.org/doku.php?id=image

  • shmk
    Avatar
    Community Member
    4 Posts

    Re: Files & Images + Thumbnails Link to this post

    > I wonder why you would need such a feature?

    Because I have a user that use a separate gallery script (not linked with SilverStripe) that needs two folders: one for the full size photo and one for the thumb.

    He use SilverStripe to upload the photos on his host, so if SilverStripe automatically create a _resampled folder directly on photo upload I could modify he's script to point to the image folder and to the _resampled one.

  • banal
    Avatar
    Community Member
    901 Posts

    Re: Files & Images + Thumbnails Link to this post

    Ah I see. So the gallery script isn't built with a SilverStripe template, where you could set the Image size.. right?
    The problem is, that you need to call the resizing method somewhere first to get a generated thumbnail. Your best bet would probably be to create a DataObjectDecorator for the Image class and there create a onAfterWrite method that takes care of the thumbnail generating.

    1873 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.