JetEngine Compatible Conditions

Hello,

I am hoping someone can help here. I have a JetEngine CPT created with a checkbox metafield, that metafield then has numerous checkbox options. I would like to show a certain element ONLY if a relevant checkbox has been clicked on the post page.

Any ideas how I can do this please?

Thanks.

1 Like

Need that as well…

There is a post in Bricks Academy about that, but didn’t help.

Still looking for an answer to setup the condition logic when the value is an array.

this should help you out JetEngine Checkbox Condition in Bricks - BricksLabs

Thank you Panag, I’ll check that out later.

It is sad to know that we need to go through that rustle when we are using JetEngine.

No luck with that as well for me.

Ok, so, the post which Panag sugested helped me a little.

I’m using JetEngine and CCTs. That post helped me understand some things which led me to the below function. You just need to change the variables and white list it.

//
function get_refei_dieta_array($option) {
global $post, $wpdb;

$current_post_id = $post->ID;

$refei_dieta_data = $wpdb->get_var(
    $wpdb->prepare(
        "SELECT refei_dieta FROM wp_jet_cct_dietas WHERE cct_single_post_id = %d",
        $current_post_id
    )
);

if ($refei_dieta_data) {
    // Deserializa o array de 'refei_dieta' para verificar os valores
    $refei_dieta_array = maybe_unserialize($refei_dieta_data);

    return in_array($option, $refei_dieta_array, true);
}

return false;

}
//

For those who use JetEngine, upvote and like the below post:

Hi all, this was bugging me for a while too - finally figured it out. In the article posted in the Bricks Academy there is a section titled: “How to compare dynamic data against the value”

Using Jetengine Checkboxes (set to Array) adding the :value to the checkbox field looks at the value of the key stored in the database and will show according to the values ‘contained’ in the array.

This 100% got this working for me!