Any way to force login popup to open by url query string?

(Vinoth Kannan) #1

I know it may be an unusual request. But am I like to find a way to do it. Is there any way to just display login or signup popup on page load when a user landed on that page with some special query string?

For example

When the URL’s query string looks like above I want to open login popup on that page itself

(Kane York) #2

Not currently; the only URLs that automatically pop up the login box are /login and /signup.

(Steven Slade) #3

It isn’t exactly what you are trying to do, but I’ll share what work I’ve recently done with modals on our Discourse.

We wanted a modal to appear after a user took a particular action (clicking a button). I put the modal handlebars/html in a plugin outlet and using CSS set it to display none. Then, when the user takes the desired action, I set the modal to display: block.

Here are some thoughts I have for your situation that I’d be happy to brainstorm with you:

• Using JS, could you check the url for a particular query and, if the query string existed, display the modal? This would work on the initial load but you might also be able to utilize api.onPageChange() to check the url as Ember is doing it’s magic.

• The aforementioned JS could potentially be placed in the application route?

(Vinoth Kannan) #4

Thanks for your responses @riking @stevenpslade

I will check these methods on mine and let you know. Thanks again :slight_smile: