I recently stumbled upon Jörn Berkefeld‘s comment under a LinkedIn post describing how to add a pop-up window to a CloudPage. Jörn wrote:
Main issue with approach is that 9 times out 10 the user’s browser will block that these days. There was a time when code like yours was used to open hundreds of spam windows to mess with users. That’s why overlays are mostly used now which live in the same tab/window as the original page.
I couldn’t agree more, so if you want to implement solutions for your clients that are more from this century than the previous one, here are a few examples of overlays that you can easily use on a Salesforce Marketing Cloud CloudPage.
What are overlays?
The term “overlay” means that the additional content you are displaying for your users is displayed “on top” of the existing content. The overlays can either block the content underneath until the user interacts with the overlay, or allow interaction with both the overlay and the underlying content at the same time.
Modal Dialogs
A modal dialog is a window that appears on top of the main content, requiring user to do something before they can return to the main content. They often dim the background to focus attention on the dialog. They are commonly used for alerts, confirmations, forms, and notifications that require response from the user.
Here’s the code used to create the above modal dialog window:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A slide-in panel is a window that slides into the page from the side of the screen. It only overlays part of the main content, allowing the user to interact with both the overlay and the main content at the same time. It’s used for any optional, additional content that you want to display for the user.
Here’s the code used to create the above slide-in panel:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A toast notification is a small window that appears in a non-intrusive way and provides feedback or information to the user, without blocking the user’s ability to interact with the rest of the page. It’s typically used for brief messages like status updates, form submissions, or reminders.
Here’s the code used to create the above toast notification:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters