Copy link to clipboard
Copied
Anyone know how to add a browse function for images to a user web app form?
The image field type is media, but when restoring to default in the edit layout, the resulting form only gives me a file import "choose" button.
I need it to let the user browse in the designated directory OR have the option to upload an image from their file - just as the web app you can in the back end admin when you click "select" in the media field under item fields.
I've had two "chats" with support now who said they'd take a look at why the "restore to default" function isn't detecting the media field correctly and that they'd email the answer, but haven't heard back from them.
Is this a bug, or am I missing something obvious?
Copy link to clipboard
Copied
The 'browse existing images' functionality would have to be built, just like the one that the BC admin UI uses had to be built.
There may be a way to re-use that one on the front end, but I suspect it's strongly coupled to the frameworks in use.
Copy link to clipboard
Copied
Thanks for your answer, Robert.
I would have thought this functionality would be pretty fundamental for creating a user-friendly environment for the user.
I suppose when you say that it's 'strongly coupled to the frameworks in use' that it's not an easy task?
Copy link to clipboard
Copied
Yes. For starters, it's difficult just to get the list of images in a folder from the frontend.
Copy link to clipboard
Copied
I built the Image Deskman BC App which does this in the app inside admin tool, until BC opens v3 API up to the front end you can't get a dynamic list of files in a folder server side... If your files didn't change you could cheat and generate a list of files as a static JSON file for example and then load with javascript to and make something from that.