Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Quick / safe exit button

Avatar

Level 1

We're wanting to put a floating quick/safe exit button on some pages so if the user clicks on them, it'll take them out of our site to a completely different one.

 

Has anyone done one before?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @LauraG not sure if I understood the requirement correctly. You can create a simple button component which extends core button and style according to your requirement. You can author this on which ever pages you want to show.

Hope this helps,
Krishna

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @LauraG not sure if I understood the requirement correctly. You can create a simple button component which extends core button and style according to your requirement. You can author this on which ever pages you want to show.

Hope this helps,
Krishna

Avatar

Level 4

If your requirement is to inform a user that they leave the website, you can add the  "beforeunload" event listener into your main client library that will display the popup
(example here: https://dev.to/melvin2016/how-to-show-a-are-you-sure-to-leave-leave-site-etc-dialog-box-in-the-brows...)

But in my sight, it could be safer to have another special redirect page with that message, the same way it is, for example, on LinkedIn. And you can use that redirect page for all external links. (The resulting links will be something like /content/<project>/redirect.html?path=<originalUrl>)

You even can use something like LinkRewriter service to update all external links to this behavior, in order to cover all the components + custom links from RichText component. Or use rewrite on dispatcher side, if you have AEM on-premise. However, custom components that use javascript redirection should be covered in their (FE) code anyway, so maybe the first approach with JS event is better though.