10930 Posts in 2613 Topics by 1810 members
|Go to End|
19 February 2009 at 5:59am Last edited: 19 February 2009 6:01am
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.
19 February 2009 at 6:12am
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
19 February 2009 at 6:18am
Aram, thanks! You saved my day!
19 February 2009 at 7:37am
The ImageDataObjectManager is more feature-rich and would do a better job than the HasManyFileManager. That will be ready in a few days.
|Go to Top|