You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that an improvement code is necessary, when using custom directory with a singleFile collection.
If custom PathGenerator class does not use the primary key in the custom directory, this process deletes the entire directory, therefore the images it has just created…
AddMedia creates file.jpg, responsive and conversion files too, but just at the process end w directory is deleted!
To work around this problem, you must clean up the collection before AddMedia with the function clearMediaCollection
But the best would be that it is written in the code of your library ;-)
FYI, I use this directory structure with [model_id] key because if we update often, a structure with the primary key regularly changes the path of the image, which generates too much 404 error for SEO.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello Freek,
Just a comment
It seems to me that an improvement code is necessary, when using custom directory with a singleFile collection.
If custom PathGenerator class does not use the primary key in the custom directory, this process deletes the entire directory, therefore the images it has just created…
Sample with a structure using model_id key
AddMedia creates file.jpg, responsive and conversion files too, but just at the process end w directory is deleted!
To work around this problem, you must clean up the collection before AddMedia with the function clearMediaCollection
But the best would be that it is written in the code of your library ;-)
FYI, I use this directory structure with [model_id] key because if we update often, a structure with the primary key regularly changes the path of the image, which generates too much 404 error for SEO.
Regards
Jm
Beta Was this translation helpful? Give feedback.
All reactions