Skip to main content
Samuel Brown
Contributor ⭐️⭐️⭐️
Mar 29, 2024 1:54 PM UTC
Question

Trigger the Login or Registration pop-up modal from any HTML link

I randomly discovered that you could do this while optimising some of the code for our own community. I thought it was a good enough tip to share with all of you. If you’ve got any HTML element that you can freely control then wrap your link with the following code.

Triggering the modal to show at the login page:

<a class="loginmodal-link js-open-modal qa-register-have-account-link" data-modal="login" data-mn="ItemView" data-mn-app="frontend">Name of link here</a>

Triggering the modal to show at the registration page:

<a class="loginmodal-link js-open-modal qa-register-have-account-link" data-modal="register" data-mn="ItemView" data-mn-app="frontend">Name of link here</a>

Hope this helps!

7 replies

Jef Vanlaer
Helper ⭐️⭐️⭐️
Mar 29, 2024 3:39 PM UTC

Coincidentally, I was trying to add a link to the registration or login page inside a Community post today. I guess that doesn't really work with this code, does it?

Translate
Samuel Brown
Contributor ⭐️⭐️⭐️
Mar 29, 2024 3:42 PM UTC

@Jef Vanlaer - Not that i’m aware of. I don’t think you can add classes to URLS on posts without adding some custom javascript in there to catch the URLs dynamically. The only alternative is to directly link to your registration page using:

https://change-me.com/member/register

 

Translate
Jef Vanlaer
Helper ⭐️⭐️⭐️
Mar 29, 2024 3:50 PM UTC

@Samuel Brown It seems like that url doesn't exist on our community:

 

Translate
Samuel Brown
Contributor ⭐️⭐️⭐️
Mar 29, 2024 3:52 PM UTC

@Jef Vanlaer - My bad! It’s member not member(s) in the URL. I’ve adjusted the original comment to reflect this.

Translate
Jef Vanlaer
Helper ⭐️⭐️⭐️
Mar 29, 2024 3:54 PM UTC

@Samuel Brown Awesome! It also works with /login apparently, so this fully solves my use case 👍

Translate
Kenneth R
Expert ⭐️⭐️
Apr 2, 2024 9:36 AM UTC

This is an awesome tip @Samuel Brown - thank you for sharing it!

Translate
jvdc
Expert ⭐️
May 6, 2025 6:14 PM UTC

Amazing! I was about to post a question about this and your post was suggested. Works like a charm!

Thanks for sharing!

 

By the way, what is that floating banner that you're clicking on? ​@Samuel Brown 
Would you mind sharing how you implemented that?

Translate