Skip to main content
Question

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


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!

6 replies

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

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

 


Samuel Brown
  • Author
  • Contributor ⭐️⭐️
  • 7 replies
  • 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 ⭐️⭐️
  • 187 replies
  • 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
  • Gainsight Community Manager
  • 430 replies
  • April 2, 2024

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings