Skip to main content

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!

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?


@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

 


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

 


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


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


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


Reply