File upload modal on front-end is always empty
Created 5 years ago by dav0r

Hi, I've recently switched to Pyro (and loving it so far!) but I'm having a bit of difficulty with a front-end file upload modal.

I've created a simple module which allows site administrators to post job openings through the control panel which guests can then view and apply for by selecting the job and uploading their CV.

I'm displaying the form on the front-end using {{ form|raw }} (provided by the form builder in my controller) which displays everything fine. However when a user clicks on the 'Upload' button for their CV, the modal's dark back drop appears and the empty file upload modal gets the 'show' class applied to it, but the modal content div remains empty.

The upload button's href for the modal is correct ([base url]/streams/file-field_type/upload/applications) when I visit this in a new tab, it displays an unstyled file upload page.

I'm guessing I'm not including a required script or something else relatively simple and was wondering if you could help point me in the right direction!

Thanks, Dave.

dav0r  —  5 years ago Best Answer


For anyone else who's has this issue, after a bit more tinkering, I tested the form using the starter theme and found that the modals were working perfectly.

After comparing themes, I saw that I was missing {{ asset_script("js/app.js") }} in my assets partial, all working as expected now! 😄