Browser: Chrome 110 OS: macOS / Windows / Linux / etc. URL: Link to a page that illustrates this issue Video: Short screen recording that illustrates this issue (free tool: jam.dev)
I have a relationship field loop on a post type that renders perfectly, however inside that post (relationship) type I have a true/false field and I want to render the fields only if the value is true.
My setup is the following:
If i put the following condition to the loop div only the false condition returns the value.
**This condition works.**
Dynamic Data
{acf_personnel_active:value}
==
0
**This condition won't work.**
Dynamic Data
{acf_personnel_active:value}
==
1
If I put the condition to the Element div, than the true condition also works but an empty loop div gets rendered.
I don’t know why the false condition works and the true doesn’t on the first version.
Not sure if this is a bug or am I doing something wrong.
It sounds like the issue might be with how Bricks processes conditional logic on loops. Since the false condition works but the true one doesn’t, try explicitly casting the value to a boolean or checking for string vs. integer comparison issues. Also, test using {acf_personnel_active} instead of {acf_personnel_active:value} to see if that changes the behavior. If the issue persists, it could be a Bricks or ACF quirk, consider reaching out to their support or checking their forums for similar cases.
I already tested the {acf_personnel_active} without the :value and I also did test it with is not comparison equators, but everything I tried goes back to rendering perfectly if the value is false and not rendering at all if the value is true.
Great, you’re welcome
The condition does not take effect because it is executed before the loop and returns always false. This is the expected behavior and not a bug.