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

**URL:** <https://meta.discourse.org/t/any-way-to-force-login-popup-to-open-by-url-query-string/46193>\
**Category:** Feature\
**Created:** [2016 年6 月 22 日 15:43 UTC](https://meta.discourse.org/t/any-way-to-force-login-popup-to-open-by-url-query-string/46193 "2016-06-22T15:43:36Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

作者： ![stevenpslade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stevenpslade/32/53550_2.png) [@stevenpslade](https://meta.discourse.org/u/stevenpslade)\
发布日期： [2016 年6 月 27 日 23:43 UTC](https://meta.discourse.org/t/any-way-to-force-login-popup-to-open-by-url-query-string/46193/3 "2016-06-27T23:43:37Z")

</div>

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?

---

_[View the full topic](https://meta.discourse.org/t/any-way-to-force-login-popup-to-open-by-url-query-string/46193)._
