• Resolved Aurélien Denis

    (@maigret)


    Hello!
    I’m looking for a hook to customize file field rendering with a custom form. Right now, it show filename, file size, file icon. It’s not very convenient for a form built for customers (using it to allow them to upload their own avatar).

    With ACF, I can achieve this task following this guide: https://www.advancedcustomfields.com/resources/file/

    Not sure how to do the same with ACF Extended in a form.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    I’m not sure to understand your question. ACF Extended Free only let you change the File Upload Type from the UI (Basic or WP Media Modal). That setting can be changed with ACF alone too, but not from the UI.

    The link you shared on the ACF documentation explains how to display the value once it has been uploaded. This documentation tutorials also work to ACF Extended, since it doesn’t change how the file is uploaded.

    Can you please give more details, share a screenshot or a precise example of what you’re want to customize?

    Have a nice day!

    Regards.

    Thread Starter Aurélien Denis

    (@maigret)

    Hi Konrad,

    sure, let me give you more details.

    My goal is to create a form with your plugin. This form is for users in front. We’d like to allow users to change their profile photo, so I create a form with a file upload field. It’s saving and loading values in form settings and everything is great: a user can upload a photo with native browser UI and the image is correctly saved to their profile.

    The problem is about loading values. By default, it shows several metadata which are not very useful for user. It would be better to display the photo and the field to upload a new one.

    As far as I understand, this behavior is not managed by your plugin (I mean by form settings) but by ACF itself?

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Okay I see. You guessed it right, ACF handle the field value render. Generally speaking, ACF fields are rendered the same in the admin and on the front-end, including the JS and most of the CSS too.

    There is a setting in the ACFE Pro package allowing to choose how the File value is rendered, but I doubt it will be useful in your case (avatar upload).

    A workaround could be to add some CSS in order to hide parts and change how the value is rendered. An another solution could be to use an ACF Image Field instead, since it only display an image when the value is rendered.

    Hope it helps!

    Have a nice day!

    Regards.

    Thread Starter Aurélien Denis

    (@maigret)

    Hello,

    thanks for your explanations, it makes sense!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Customize File Field with Front Form’ is closed to new replies.