I have been building a site for a photographer with many galleries and thousands of images.

It would be very nice if, when the gallery items are uploaded, they are placed in subdirectories based upon the name of the gallery. This would allow users to better deal with the files stored in the gallery.

So, in the default configuration, we might have....

sites/default/files/node_gallery/gallery1/[files]
sites/default/files/node_gallery/gallery2/[files]
etc.

Looking at the code this seems possible, but I haven't been able to get it to work so far.

Comments

zengenuity’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

This should be possible with the Filefield Paths module. You can set the directory paths of the gallery item files, using the node_gallery_ref field tokens for adding the gallery node ID or title to the path.

jaylotta’s picture

Brilliant! Worked like a dream and you are a lifesaver.

One other thing....

Can I somehow make node gallery delete all of the images when a gallery is deleted?

zengenuity’s picture

That's not built in, but it could possibly be done with the Rules module, I think, by creating a rule on gallery node deletion.

jaylotta’s picture

I used the Filefield Paths module, changed the paths of some existing galleries and retroactively updated the files to the new directories.

After that all of the Node Gallery display settings and some of the File display settings where messed up.

For instance, in Gallery Item > Manage Display, the Gallery Media field's format was no longer Rendered File but Generic File and the View Modes were all reset to default.