• Resolved richardu

    (@richardu)


    I’m creating a form to add posts to a CPT. I have a field group for that CPT which I have added to the form, but I really only want to show a couple of these fields on the form.

    What is the best practice for limiting the fields shown on an ACFE form?

    Cheers, Richard

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

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    There’s different ways to achieve this:

    1. You can use the “Override HTML Render” setting in the Form UI and display the fields of your choices. See screenshot.

    Note that this solution will completely override the Form Render, so you’ll have to include all your fields (or field groups) in that setting. But it will also let you add some custom HTML elements such as titles or sections between them which can be quite useful.

    2. You can use the Advanced Field Settings (See documentation). This new setting will let you define which field should be displayed everywhere/in the admin only/on the front-end only.

    In order to use it you’ll have to enable the “Advanced Settings” setting in your Field Group UI, and save the Field Group. Once updated, each field will have new settings available, including that new feature.

    3. You can use the native acf/prepare_field hook (See documentation) in order to hide a field on the front-end by using return false in that filter. You can use is_admin() as a condition in there aswell.

    4. You can use the Field Visibility Widget (See documentation), which is kind of similar to the Advanced Settings above, but easier to access. Note that this feature is in the Pro version of ACF Extended.

    Hope it helps!

    PS: Thanks for the nice review ??

    Have a nice day!

    Regards.

    Thread Starter richardu

    (@richardu)

    Thanks for the great answer. I glossed over the HTML section because I saw the Before and After and assumed it was all about that.

    Maybe there would be a way to rename “Override Form render” to something that reveals its power — maybe something like: Specify Fields and HTML

    The word “Override” is perfectly appropriate, but somehow uninviting for someone looking for a “basic” modification. Or maybe it’s just me. Anyway, hope this helps someone who is making the same assumption I did.

    Cheers, Richard

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Yes I can understand. That part of the UI will be reworked in the next update. Hopefully it will become easier to understand.

    Have a nice day!

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Simple question about Form Fields’ is closed to new replies.