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.


Our old forums are still available as a read-only archive.

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

Albums in Gallery


30 Posts   5828 Views


21 November 2008 at 4:06am 4085 Posts

If you're just showing photos, you guys might want to try out my extension to the Gallery module here:

Album support in the next release..

Carbon Crayon

21 November 2008 at 4:53am Community Member, 598 Posts

I will post a complete example tonight :)

UncleCheese: I love your extension, it's just what I wanted for controlling the images, particularly the drag and drop reordering, great work! I think what I was doing here to have a gallery holder should still work the same with your extension, all I'm doing is calling each childs first page images to display in the holder. Kind of like are you going to do the albums in your next release?


21 November 2008 at 5:10am (Last edited: 21 November 2008 5:13am), 4085 Posts

Glad you like it! You gotta love bulk uploading, right?

As of now, I'm using a basic "GalleryHolder" page to loop through the child pages for "album" management. Works fine. It's a little heavy, though, because each ImageGallery page just carries so much data around with it that is essentially redundant (per page, popup size, etc..). But for now, that should work fine for you.

Two things I have in mind for albums -- an image gallery page will get an Albums tab, which will be a simple TableField to manage a has_many relation to albums. On upload, you'll get a select box that will let you choose the album you're uploading to.

I'm also wondering if I can use the DropdownField_WithAdd (I believe that's the name) to manage albums on the front end. That would all you to choose an existing album, or add one right there.

The big question, though. How do you move all photos from one album to another? Agh!

Ideally, of course, we're eliminating all the noise of having multiple pages for each album, each with its own configuration, etc. It's too much. The next release will allow you to call an album name through the Action segment in the URL.

Shouldn't be too long. I'll start work on it today if I can.

Carbon Crayon

21 November 2008 at 8:29am (Last edited: 21 November 2008 8:29am), Community Member, 598 Posts

haha, I hadn't even realised you could batch upload, that rocks!

The albums sounds awesome too, you're right it's a little heavy at the moment having all those settings per gallery, and also annoying if you want to change the sizes of thumnails etc you gotta do it in all the child galleries.

Are you going to tag each image to decide which album it's going into? If so then to move from one album to another all you'd have to do is batch edit that tag right? In the popup for each album you could have an option to merge/transfer the images in that album into another. Perhaps I'm oversimplifying that, a lot of the stuff you've done is above my level at the moment :)

Anyway great work mate, looking forward to seeing what you come up with next!


21 November 2008 at 11:18am Community Member, 79 Posts


Did you have that code to create the album? it would be helpful if you could upload it.


21 November 2008 at 11:22am 4085 Posts

New version is just about ready. Give me a few more hours.


21 November 2008 at 11:53am Community Member, 79 Posts

I am actually after Arams code as described earlier in the thread
and hoped he could upload the 
GalleryHolder.php, that he had working

Carbon Crayon

21 November 2008 at 12:24pm (Last edited: 21 November 2008 12:30pm), Community Member, 598 Posts

Ok the .php and .ss files are in the zip below.

Basically all im doing is cycling through the cildren of GalleryHolder and calling the function CurrentGalleryItems, which is then formatted by the same code that is in GalleryPageContents inbetween the <% control CurrentGalleryItems %> <% end_cotntrol %> call.

I also copied the init function from GalleryPage.php so that the lightbox will work on the holder page.

If you have any trouble let me know, I have quickly remade these files as I had some other customisations in there that I've taken out, namely a different lightbox (shadowbox) and a CSS layout for the thumbs, so I havnt actually tested these files. They should work though, theres nothing complex in there.