1

I'm building a gallery system and on the entry page I have fields for gallery category (category field) as well as gallery photos (assets field). When creating this entry, I would like to upload the assets field to something like:

images/galleries/category/slug

However, because the category is still being defined in the same entry as the assets are being uploaded, my images aren't put into a folder based on the category.

Is what I'm trying to do possible? What's the best way to approach it? I'm currently using this for my assets file path:

images/galleries/{galleryCategory.first.slug}/{slug}

2

I've ran into something similar, although it was using the entry ID. If you set the category and save the entry, and then upload an asset to that field on the entry does it save into the location you have set?

Also if the assets field is within a matrix you'll need to use owner

{owner.galleryCategory.first.slug}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.