Showing a Popup conditionally in Bricks based on Query Parameter

This Pro tutorial provides information on two ways a Bricks Popup can be shown on page load depending on whether the URL has a specific URL parameter with a specific value.

Ex.:

Show the popup only if the page URL is

https://example.com/sample-page/?etsTicketWidget=basket-detail

After implementing the tutorial, the popup will not appear if the query string is not present when accessing this page or when the value of etsTicketWidget is something other than basket-detail.

Step 1

Create a Bricks template of the type Popup and add your desired elements inside.

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 537 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Weekday Condition in Bricks

Weekday Condition in Bricks

As of Bricks 1.7, the built-in "Weekday" condition does not work correctly. This is most likely due to it not taking the site's timezone (set…
Categories:
Render an element having a specific HTML ID based on value of a custom field

Render an element having a specific HTML ID based on value of a custom field

This tutorial provides the steps to use Bricks' bricks/element/render filter to conditionally output an element that has the specified HTML ID based on the value…
Categories:
Pro
User Role Condition in Bricks

User Role Condition in Bricks

This Pro tutorial provides the steps to conditionally output elements depending on the currently logged-in user's role. Step 1 Create a section Template having the…
Categories:
Bricks Condition for WishList Member

Bricks Condition for WishList Member

How to render a Bricks element only if the user has access to a specified WishList Member level.
Categories:
Pro
Conditionally outputting an element in a Query Loop based on date-type custom field

Conditionally outputting an element in a Query Loop based on date-type custom field

This Pro tutorial shows how to output an element in a Bricks' query loop only if the value of a date-type of custom field for…
Categories:
Pro
Conditional Rendering in Bricks Based on CSS Class

Conditional Rendering in Bricks Based on CSS Class

Updated on 19 Jun 2024 A user asks: Is there a way to apply the same conditions to several elements like we set styles appending…
Categories:
Pro
Dynamic URL Parameter Post Popups in Bricks

Dynamic URL Parameter Post Popups in Bricks

Bricks 1.9.4 added AJAX support for Popups via its Popup Builder. popupContextId can be now set in bricksOpenPopup() which means a popup can be set…
Categories:
Tags: