WAIT: Conditions will not work if 0

Today-Builder-
This condition will not work
using Metabox checkbox

Data

This field saves the “checked” and “unchecked” values in the database as “1” or “0”.
any thoughts help, maybe a bug.
I would like to filter and render the ones that I have checked, at the moment I can only rdern the unchkeck ones “0”
thank you

Hi parsec,
try with :

  • == 1
  • != 0
  • == true
  • != false

One of these should work.

Jacopo

Use a meta query, not a condition.

Replace featured with the meta key of your field.

Thank you for your time. But still does not work


Hey @parsec ,
Have you tried it using the 1.10 beta? It might work, but the report is about a text field and not a checkbox:

Even if 0 is stored in the database, PHP interprets the 0 as false and returns nothing (contrary to true/1).

If the condition should only apply to true, i.e. 1, compare against 1 instead of 0 (== 1).

1 Like

Hi @parsec ,

Seems like you are using a custom table for the meta value.
If so, you cannot use a normal Meta Query for that.
Please refer to MB Custom Table - Meta Box Documentation

If you are using a condition, please ensure you are placing the condition inside the query loop, NOT on the query loop. As the condition will be executed before the query, which means Bricks is getting the check_to_render value from the current page post instead of looping post.

Regards,
Jenn

Thank you. I have try this please see attached but still not working . Thank you for your help

Hi @parsec ,

The Image and Heading should be wrapped inside the Block Condition right?

If it doesn’t work, please send admin access to help@bricksbuilder.io and include this forum thread in the email.

Regards,
Jenn

I have send an email for you to log into the site. Thank you very much for your time
John