Hi I'm looking for some idea how to do it
In my own modules ( articles / gallery / carousel ... ) created in October CMS Builder plugin using filed type mediafinder for images and documents.
Im need in my plugins open backend media browser - directly in user defined folders?
for example
articles in folder: /storage/app/media/articles
gallery in folder: /storage/app/media/gallery, or better /storage/app/media/gallery/id (if id gallery exists - or create subfolder if not exists )
carousel in folder: /storage/app/media/carousel
I don't need any restriction - user can change folders directly from media browser if wants. But opened must by in subfolder defined in plugin.
thank you
Vaclav
There is currently no way to set the default media finder path, this feature was requested in GitHub but never implemented. Issue link here.
EDIT: Following up on Hardik's comment, that is actually a really nice workaround for adding a path to media manager/finder.
You can modify the controllers create/update methods to include the path in the session. I'll include an example for the update method since the link he provided has the create one.
You can also use the MediaLibrary API to handle checking for a folder and creating a new one if needed for your gallery. Specifically the folderExists(string $path) and makeFolder(string $path) methods