The Popup Builder, introduced in Bricks 1.6, is a very flexible, fully customizable solution to show popups anywhere on your website based on Interactions.
A popup in Bricks is just a template. To create our first popup, let’s add a new template, and select the new template type Popup like so:
Save the new template, then edit it with Bricks.
You’ll immediately notice that this template looks different than other Bricks template types.
The popup content shows centered on the canvas, there is a new “Template Settings” group named “Popup”, and there is no “Populated Content”:
Building out the content of your popup is the same process as on any other page or template in Bricks: You simply add the elements you need to the canvas via click and/or drag & drop.
Use the template conditions inside the builder under “Settings > Template Settings > Conditions” to tell Bricks where on your website this popup should appear.
You can add as many popup templates to a page as you like.
Popup-specific settings are located under “Settings > Template Settings > Popup“.
The first control group lets you style the popup overlay & content:
You can globally style your popups via the “Popups” control group inside your Theme Styles.
Further down the popup settings panel, you’ll find the Interactions control group.
This is where you define the trigger(s) to open/close the popup.
Triggers are browser events like “Content loaded”, “Scroll” (by X pixels), moving the mouse outside the window, etc.
A commonly used trigger is to show the popup once the content is loaded (e.g. newsletter popup, special offers, etc.). To do that, set a “Content loaded” interaction like so:
NOTE: Clicking outside the popup content (on the overlay) or pressing the ESC key closes the popup.
If no interactions are defined on the popup itself or any other element on the page that triggers the popup to show, the popup remains hidden.
By default, the popup shows every time it is triggered by an interaction.
You can also define popup limits under “Settings > Template settings > Popup > Popup limit” when editing your popup template.
Once a limit has been reached the popup is no longer displayed.
There are three types of popup limits, and the counter for each increases every time the popup is displayed:
|Limit type||Browser storage||Description|
|Per page load||Resets after page load|
|Per session||Resets after tab close|
|Across sessions||Resets once deleted|
Example: Popup inside query loop
You can also add a popup inside a query loop via the Template element. Inside the popup template, you can use dynamic data to display data of the loop item.
The screenshot below illustrates the setup for a “Quick view” button that shows a popup template with a “Add to cart” button, the product short description, etc.
We’ve also set an interaction on the button inside the query loop that shows our “Quick view” popup template when it’s clicked.
Example: Show popup when mouse leaves the browser window (exit intent)
After setting up the popup template, and creating the layout, go to “Settings > Template Settings > Popup“, scroll down to the Interactions group, and add the following interaction:
Example: Add popup close icon (using interactions)
To create a popup close icon that is triggered when clicking on it, let’s add an Icon element to our popup. Any element works, though.
Tip: When editing the Icon element, set the “Cursor” style under Styles > Layout > Misc to “pointer”. This offers a better visual hint that this is an interactive icon.
Open the Interactions panel when editing your Icon element, and create a new interaction of type “Click”, set the target to”Popup”, select the popup, and set the “Action” to “Hide element”.
If you are planning to use this popup close icon in more places creating a global close popup element might be a good idea.
After saving this element as a Global Element, you need to use a different approach when setting the close popup interaction so it can target any popup. In this case, use “CSS selector” as the “Target”, and set the “CSS selector” to “
.brx-popup“, like so:
Example: Show popup before a certain date/time (using element conditions)
While the template conditions determine on which pages the popup appears, you can further restrict a popup by defining Element Conditions on the outermost popup element.
To only show a popup before November 1st, 2022, you’d set the following element condition on the outermost layout element of your popup:
If this element condition is not fulfilled, meaning Nov 1st, 2022 is reached, then the popup HTML is no longer rendered. So even if the popup is triggered by an interaction, it won’t show as there is no popup HTML to display.