Support

Account

Home Forums Add-ons Gallery Field Acf form with basic uploader for a gallery field

Solving

Acf form with basic uploader for a gallery field

  • Hello,

    Is it possible to display the basic uploader for a gallery field on my acf form ?

    Thanks

  • No, there isn’t a way to use the gallery field for users that are not logged in or do not have permissions to add media.

    To do what you want you would have to use to supply a different field for users than what is available in the admin. Create a gallery field for use in the admin and a repeater field for use on the front end. Then you would use acf/prepare_field on each of these to show/remove one of these fields dependent on if shown on front/admin. Then you would need to create an acf/save_post action that would get the values from the repeater when a form is submitted on the front end with acf_form() and update_field() on the gallery field to add the images to the gallery.

    Overall this would be a lot of work. The easier option is to just use a repeater instead of the gallery and then code display of the gallery to use the repeater instead.

  • Is that a solution though? If you need to get users to upload 10, 20, 30 photos from the form, forcing them to upload them one by one through a repeater field doesn’t really feel like a solution…

  • We have not found what we’re searching for yet…

    By the way, thanks for your help.

  • @guillermo is it a great solution, no, is it “A” solution, yes.

    If I needed to do this I would look to something more complex, like creating permissions in WP to allow the use of what was needed. I have no idea what I’d end up with because I’ve never had to do it, but I do know that it is probably possible. Doing this would be outside of ACF.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.