1

I have a projects section on my website, there can be multiple projects from one client. Each project has at least one image.

I wanted to know if it is possible when uploading assets to a new project entry to be able to create a new subfolder within my specified assets folder for that particular client?

So can I either:

a) Create a subfolder when uploading assets. b) Use the value of the "client" field to dynamically create a subfolder when uploading images to the entry.

Any help/direction this would be appreciated.

Jay

  • Never mind, n00b moment - figured it out. – toffeejay Apr 9 '15 at 10:03
1

Yes that's totally possible, you just need to set your asset field to upload all assets to a single folder and then you can set a sub-folder path that's created dynamically. (→ Restricting Uploads to a Single Folder).

In your case that path would be something like this:

assets/images/projects/{{ object.client.first().friendlyName }}

or with fallback to a default sub-folder:

{{ object.client.first()|length ? object.client.first().friendlyName : 'Other' }}
| improve this answer | |

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.