21st Aug '24
/
0 comments

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 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
User Role Conditional Output in Bricks

User Role Conditional Output in Bricks

This Pro tutorial provides the steps to output elements based on their CSS class to users of the specified role in WordPress when using Bricks…
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:
Conditionally Outputting Based on Query Count in Bricks

Conditionally Outputting Based on Query Count in Bricks

Update on 22 Sep 2023: There's a much simpler built-in method now. See this post. In the Bricks Facebook group a user asks: Is there…
Categories:
Post-specific Dynamic Info Popup in Bricks

Post-specific Dynamic Info Popup in Bricks

This tutorial provides the steps to show post-specific data (post title and post content) in a popup using Bricks' Popup Builder and Interactions features. Step…
Categories:
Pro
Conditional Section when Post has a Featured Image in Bricks

Conditional Section when Post has a Featured Image in Bricks

This Pro tutorial provides the steps to output a Section in Bricks on single posts (of any post type) only if the post has a…
Categories:
Pro
Conditional Output in Bricks based on if Content has Headings

Conditional Output in Bricks based on if Content has Headings

How to prevent the output of the table of contents if the content has no headings.
Categories:
Tags: