Jump to:

11004 Posts in 2735 Topics by 1824 members

All other Modules

SilverStripe Forums » All other Modules » Taming HasManyFileManager

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1007 Views
  • Mans
    Avatar
    Community Member
    21 Posts

    Taming HasManyFileManager Link to this post

    Hi all!

    I'm working on a site where I want to include one to several images with each page. My idea is that the images should be displayed as thumbnails in a row, and when clicked a larger version of the clicked image should appear. I looked at the Gallery module, but it seemed a little too clumsy for what I have in mind.

    At first glance the HasManyFileManager module seemed right for the job, and as far as the documentation goes it works like a charm. But I have no idea how to make it do anything more than that. The function $SetWidth() is mentioned, not nothing is said about what other functions are supported. But just being able to retrieve the URL of the image would take me far.

    Any suggestions?

    /MÃ¥ns

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: Taming HasManyFileManager Link to this post

    Hi Mans

    the has many file manager is simply a way to manage files attached to a page. You can use any of the usual functions/variables in the template as you would for any other images on the files which are attached to a page.

    For example: $Image.SetWidth(150), $Image.SetHeight(150), $Image.CroppedImage(150,150) etc.

    and for image info $Image.URL or $Image.Title etc.

    The GD docs show the image resizing functions, but unfortunately it only shows the functions you can use in your PHP classes, not the (strangely) renamed ones for the template: http://doc.silverstripe.org/doku.php?id=gd

    hope that helps

  • Mans
    Avatar
    Community Member
    21 Posts

    Re: Taming HasManyFileManager Link to this post

    Aram, thanks! You saved my day!

    /MÃ¥ns

  • UncleCheese
    Avatar
    4085 Posts

    Re: Taming HasManyFileManager Link to this post

    The ImageDataObjectManager is more feature-rich and would do a better job than the HasManyFileManager. That will be ready in a few days.

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