SOLVED: ACF true/false value not usable in element conditions

Have the same problem with option pages and using true or false. I added the :value as @aslotta mentioned and it worked great.

But I guess this still should be considered a bug?

This is STILL not solved and is extreeeemely annoying
Why doesn’t this work? I checked with var_dump and the output is correct but it’s ALWAYS true. I tried to enter “true” and “> 0” also without any luck
Bildschirmfoto 2023-12-06 um 11.45.59

I don’t really understand your problem, but ACF true/false fields output text in the current system language, not a boolean value. You don’t need to build logical conditions right away; it’s enough to start by displaying the field value and finding it out

hmm, but when I var_dump(get_field(“my_boolean_field”)) I get a boolean and not a string

Above you write about comparison in bricks, but conduct tests in php. It’s different.

true

2 Likes

ahhh holy s*** why in the world does this work this way? That’s ridicilous! And when I change the primary language? All my conditions won’t work? I just discovered this in Adobe after effects, they translate variables as well and everything brakes – but why? This is super user unfriendly and in any other aspect Bricks is so close to development – and it’s what I love about it, like divs are divs and not boxes or whatnot, why not in this case?

I don’t know why it works this way. Yes, if you change the main language, the condition will break.
Use modifier :value for get value

example {acf_truefalse:value}

return 1 if true

Value doesn’t return anything. I tried it right now.

confirm :value does not work

Where do you use the :value filter? Within conditions, you can check against 0 (false) or 1 (true). If you output the value on the front end, only 1 (true) is output, if false, PHP returns nothing.

Report: it works now, :value on the echo for checking true/false ACF field does work.

Am I missing something?

I have my post type set up for review.
I have a field groups set up for my reviews, one of which is true/false for featured_review.
I have two dummy reviews, one of which has the checkbox checked.

I have my query loop set up to show reviews, works fine.
I then set up a condition on the query loop, showing exactly whats in your screenshot (but my {acf_featured_review:value} and then set it to 1 - but nothing shows

Not only that, if I set it to false (0), the review that is unchecked shows - which shows that this is working right? But this is the opposite of what I require.

Is there something Im missing on my custom field or something?

Bricks 1.9.7.1

Hey Mike,

this is not a case for a condition but a meta query in your query loop:

Best,

André

3 Likes

Perfect, thank you very much this works!

Does someone resolve this iusse? Still I can’t use ACF true/false or Radio Button from an Option Page

Thanks