• Resolved Damian P.

    (@damian-p)


    Hi!

    I have ACF checkbox field with two options. Now, I want to create box which will be visible if any of checkbox will have any value – and this is clear for me. But inside this box, I would like to add two images. First should be visible if checkbox 1 will be checked, second when checkbox 2. How should I do it in Block Visibility?

    I’m trying like “Value is qual to: 1” but this not working…

    Thanks for advice 🙂

    • This topic was modified 2 years, 1 month ago by Damian P..
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi @damian-p,

    I looked into this, and sure enough, there is no way to conditionally display a block based on a checkbox field. This is because the field value is stored as an array, which Block Visibility is currently not equipt to handle.

    That said, I have added this as a feature request on GitHub, and this functionality will be included in the next version, which is due out in a few weeks. I apologize for the inconvenience, but trust that this functionality will soon be available in the plugin.

    I will follow up once the release is available. Please let me know if I can be of further assistance.

    Best,
    Nick

    Plugin Author Nick Diego

    (@ndiego)

    Hi @damian-p,

    I just released v2.6.0 which now supports “choice” fields. I will update the plugin documentation this week, but for your use case, you can now use either “Value is equal to” or “Value contains”.

    If you choose “Value is equal to”, the block will only display if “1” is the only checkbox selected. If you want the block to display if “1” and/or other checkboxes are selected, you will want to use “Value contains”.

    Please let me know if you have any questions or have any additional issues.

    Best,
    Nick

    Thread Starter Damian P.

    (@damian-p)

    Thank you! I’ll try the update on my site, and if I get any issues, I will back to you with questions 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to set ACF’s checkbox field with Block Visibility?’ is closed to new replies.