Skip to main content
Question

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

  • March 29, 2024
  • 7 replies
  • 114 views

Samuel Brown

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
Forum|alt.badge.img+2
  • Helper ⭐️⭐️
  • March 29, 2024

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?


Samuel Brown
  • Author
  • Contributor ⭐️⭐️
  • March 29, 2024

@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

 


Jef Vanlaer
Forum|alt.badge.img+2
  • Helper ⭐️⭐️
  • March 29, 2024

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

 


Samuel Brown
  • Author
  • Contributor ⭐️⭐️
  • March 29, 2024

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


Jef Vanlaer
Forum|alt.badge.img+2
  • Helper ⭐️⭐️
  • March 29, 2024

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


Kenneth R
Forum|alt.badge.img+5
  • Expert ⭐️⭐️
  • April 2, 2024

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


jvdc
  • Helper ⭐️⭐️⭐️
  • May 6, 2025

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?