ideas
ideas copied to clipboard
Dynamic folder name for asset field type
It would be nice, if we could use a dynamic folder name with the asset field type:
Maybe something like folder: {slug}
, to keep the asset container tidy and e.g. assets/entries together.
It's probably more complicated than it sounds. If you change the slug of the entry, all the assets would need to be renamed too.
Good point. Currently I'm using read_only: true
on the slug field to prevent this... đŸ¤”
How about using folder: {id}
instead?
Hi @jasonvarga! I'm trying to implement this requested behavior with an EntryCreated
(create folder structure) and an EntryBlueprintFound
(update folder paths) event listener. I have the problem, that with the first opening of the publishform of an entry, there isn't a uuid until its first save (and there isn't a folder with the same uuid).
Any idea, how I could trigger uuid generation earlier, right before the EntryBlueprintFound
listener is triggered? Or how I could set the uuid manually and pass it to the EntrySaving
listener?
Not sure. The ID is generated when the entry actually gets created.