Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

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

Image Gallery Extension: Testers Needed

Go to End

417 Posts   95018 Views


Community Member, 23 Posts

15 March 2009 at 5:50am

I wanted to add png as a type of file that can be uploaded....
looking at the docs i saw that it was possible...
setAllowedFileTypes(array $types)

looking at the imagegallery code i see

'file_upload_limit' => $this->getUploadLimit(), // how many files can be uploaded
'file_queue_limit' => $this->getUploadLimit(), // how many files can be in the queue at once
'browse_button_text' => 'Upload Images...',
'upload_url' => Director::absoluteURL('ImageGalleryManager_Controller/handleswfupload'),
'required' => 'true'

i added : 'allowed_file_types' => array('jpg','png');
that of course doesn't work.

any more clues?


Forum Moderator, 4102 Posts

15 March 2009 at 5:59am

Yeah, that will get overridden by the $limitFileTypes definition in the ImageGalleryManager class, to prevent people from settingAllowedFileTypes('PHP') in an imagegallery or something stupid like that.

I think I excluded PNG because I don't believe the GD class in Silverstripe will handle PNG. Can you look into it? If it does, I'll add it in.

el berto

Community Member, 3 Posts

15 March 2009 at 6:41am

Edited: 15/03/2009 6:44am

Galleria is a JQuery plugin. I think it would need a separate template to work properly. It's not hard to add an additional plug-in to the image_gallery. I have a test version running on my work machine with old revision of image_gallery producing Galleria galleries, once its tided up (at the moment I modifying the image_gallery methods directly, I think I should be able to overwrite them in the mysite folder?) I will write up the changes I made to make it work.

UC, I upgraded to the latest commit of the image_gallery, when trying to view a image_gallery page created with a previous version the following error pops up;

Pages created with the new commit work fine. Edit nevermind... was a cache issue.

One more thing, all of the css references to images are absolute... which is fine if the site is installed in the web root, but breaks for any site installed in a subdirectory. Might it be an idea to replace them with relative links and let the base tag in the theme deal with routing them to the correct address? I'm happy to post diffs here if that would help.

Thanks again for you work.


Forum Moderator, 4102 Posts

15 March 2009 at 6:50am

Nice catch on the pathing. I just checked in a version with relative paths in the CSS. Should work, but don't have time to test. Can you try and let me know?

el berto

Community Member, 3 Posts

16 March 2009 at 2:05am

Edited: 16/03/2009 2:06am

Just checked out the new revision. All the css changes work, however, lightbox also needs the links vars changing in it's script. I've attached the updated version (only difference is image links are now relative) that fixes the issue.


El B

Attached Files

Forum Moderator, 4102 Posts

16 March 2009 at 6:46am

Awesome. Appreciate that.

If you haven't already seen the post, I'm adding a SlideshowPro extension to the ImageGallery. What does everyone think?


Community Member, 55 Posts

16 March 2009 at 10:11pm

Hi UncleCheese,
thanks very much for your great work.
We just published a website with your gallery extension.
It works great (even on windows with IIS6 ;-) ).

One extension would be good:
The params for the lightbox are within your code.
Can this be extendable so whe don't have to change your code ?

What is the best way to translate the text within your module ?

TIA Stephan


Forum Moderator, 4102 Posts

17 March 2009 at 7:23am

The popup UI components that come with ImageGallery are just there for quick-start purposes. You can select "None" for the UI in the Configuration tab, and then build your own template with any popup plugin of your choice.

Translations would be really helpful. I will add the translation tags into the template and I believe you can write your own translations from there.

Go to Top