NO BUG: Issues with POPUP Template Styles and Conditional Element Triggering

Hello Bricks Team,

We have an issue with the inline style of the POPUP template from the “Template settings → POPUP” section inside Bricks Builder. When we call this POPUP template from any other regular page using the “Template” element from Bricks, the INTERACTIONS section from “Template settings” works properly, but the BACKDROP and CONTENT styles are not implemented at all.

image

In another scenario, all styles work fine if I directly add the condition from the POPUP template directly. However, the problem arises because I can’t trigger a specific page since it’s a landing page. I can only trigger the post type overall; I can’t trigger it using “Individual” element for certain reasons. We specifically need this popup only for one page, not all posts with the same type.

image

Therefore, I believe there are two issues:

  1. The main styles of the Popup are not triggered when we call the popup using the “Template” element.
  2. The conditional element of the popup only fetches the main pages using the “Individual” element, not all post types like Posts, Product, Checkout, Funnels, Offers, etc.

Hi Ahmad,
Thanks so much for your report!

  1. the template element for popups should only be used within a query loop - there the mentioned settings work as expected: Popup Builder – Bricks Academy In other cases you should use the popup conditions, see #2.
  2. you can use the search field to search for specific posts (like in my example for “beanie”, which is a WooCommerce product):

Best regards,
timmse

Hi @timmse

the search field works with media and product type, but I can’t get the Checkout, Funnels, or Offers pages(I am using Funnelkit), and as you mentioned before I can’t use the template element for popups because I don’t have any query loop, I just want to add a specific popup for an Offer page.
and I can’t use Post type also because I have multiple Offer Pages and each one has it is own Popup.

so for certain reason the search field is not fetching these pages, could you please check this issue?

Unfortunately, I can’t say anything about Funnelkit because I don’t know the plugin. However, a quick look at the docs shows that Bricks is not explicitly mentioned, so there might be an incompatibility.

Please send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase so we can take a look :v:

Hello @timmse ,

I have sent you all the requested details; please check them out

Hi @Ahmad ,

Thanks for the login details.

The Offers custom post type (wfocu_offer) created by the plugin has a parameter of “exclude_from_search” => true when registered.

This means the offers posts wouldn’t be able to be retrieved if you search from the template condition field.

As a workaround, please use this snippet to insert the popup template on an individual post without using Bricks UI.

add_filter( 'bricks/active_templates', 'set_my_active_templates', 10, 3 );
function set_my_active_templates( $active_templates, $post_id, $content_type ) {
    // Only add the popup of current post is Offer Movifar (3, 6) (ID 22661)
    if( $post_id != 22661 ) {
        return $active_templates;
    }

    // Add 22664 popup as active templates if doesn't exists
    if( ! in_array( 22664, $active_templates['popup'] ) ) {
        $active_templates['popup'][] = 22664;
    }

    return $active_templates;
}

Please test if the styles generated well or not.

Regards,
Jenn

Hello @itchycode,

The previous code is not working properly. While it does show the popup on the requested page, BUT it also removes all the Bricks templates from the product pages ( Header template, product page template, and Footer template).

Hi @Ahmad ,

I am sorry, it was my typo

Regards,
Jenn

Thank you, it is working.