NO BUG: Condition based on ACF True/False Field not rendered

Hi,

I have recently released on site, and working on another.

In both, I have a restaurant/food truck menus.

Menus are created with ACF repeater fields.

For each, I have two true/false fields to display vege and/or spicy icons on the frontend.

On one site it work, on the one I’m working on right now, I can’t get them to work.

Both running 1.8beta2 (although the condition in the previous site was created while using 1.8b1).

Literally, the only difference between those two cases is that on the previous one when it works a menu is created within a Post template (Posts are CPTs), while the one on the backend is located in an Options Page and rendered on a single page.

Has anyone ever faced such issue?

EDIT:

Based on this post - it seems that it is a case for Option Pages.

EDIT 2:

Solution offered in the other thread by @aslotta works, so for example:

Instead of: {acf_menu-dania_menu-dania-vege} use {acf_menu-dania_menu-dania-vege:value} and for value use 1 or 0.

I think until there is a permanent fix in Bricks, it would be good to add this solution to Conditions Documentation

1 Like

Hey Dominik,

thanks for your report.

I would not consider this being a bug as the ACF field’s return value depends on the settings you choose. If you want to use it independently of any settings just use the :value filter and you can safely compare to 0 or 1 as you already saw in the other thread.

Best,

André

What you are saying would be true, if it didn’t work correctly with anything but option pages :slight_smile:

But in fact it does - posts, cpts, taxonomies, woo products. It works there as expected :slight_smile:

So it is a bug

Hey Dominik,

would you be so kind as to record a small screencast for me showing your exact setup and demonstrating the working and non-working cases? That’d help to understand the issues you’re facing.

Thanks,

André

https://consultmepl-my.sharepoint.com/:v:/g/personal/dominik_kasztelaniec_consultme_pl/EZxC-MOsMWFHkHlAJ2HaK5ABF1arVLkLKpGkbXYYuDFUSw?e=Rj1nWx

So at Kawiory Park I have a CPT called Food Trucki and a condition set only with true (without :value). It works both for CPT as well as for WooCommerce Products.

However, at The Masala Rolls, I’m using Options Page to display a menu and I need this workaround with :value and 1. If it work for CPTs and Woo Products exactly how it’s supposed to (so you enter true or false without value), why it doesn’t for option pages?

If the solution with :value wasn’t posted here, I wouldn’t be able to get there.

Hey Dominik,

thanks for the screencast. Unfortunately it is a bit hard to follow exactly without an explanation while showing.

I set up a demo site and tried to create a similar setup. No difference between “regular posts” and options pages in my case: Video uploaded to CleanShot Cloud.

Updated the video link as I accidentally did not record my audio in the first video. :smiley: Sorry.

Best,

André

This saved my day. Thanks André!