As you know ACF true/false fields when your selection are false, actually return no value … it has always been controversial behavior, but to date those at ACF have not found it to be a problem.
It return 1 only if you select true and it makes currently impossible to use conditional logic with this element as long as you don’t write code.
I find myself in a position to make an element appear if the value true is set and to make another element appear if the value False is set.
in fact if I use php function:
$a_e = get_field(‘scegli_articolo_in_evidenza’, ‘option’);
if ($a_e) {
if ($element->id === ‘spowub’) {
return false;
}
} else {
if ($element->id === ‘teryhr’) {
return false;
}
}
I can make it work correctly but with the bricks editor conditions there is no way to make it work.
So for now I will continue to use the php functions but I still wanted to point out the problem.
In practice I have 2 divs with different ids but one must appear if the ACF true / false field is set to true and the second div must disappear when it is set to false.
So in the conditional logic I have to say to hide the first div if 1 arrives and leave it visible if nothing arrives … and I can do this because in the panel I can specify the return value;
for the second div instead which must disappear when False arrives, I can’t do it because in the Bricks panel I can’t specify the return value (which should be 0) because when you set the ACF field to false it doesn’t return anything.
In the php code I can do this because I can tell it to hide the second div when the ACF field value does not exist.
I just did some more tests. If I use False instead of 0 it works. So I would say problem solved. Maybe they fixed the behavior of the true / false ACF field in the new version. It didn’t work with the old one.
We can close.
thanks anyway