Automattic/republication-tracker-tool

Is there a way to open the republish modal via query string?

joshdarby opened this issue · 2 comments

A potential use case for this would be to send someone an article url like https://mysite.org/articles/my-article?republish-this-story that would then auto open the modal when the page is loaded.

benlk commented

Would the query string toggle whatever class we use to show the modal? Or would it be read by the JS on the page which opens the URL in response to the query string's presence?

If it's JS-based, a hash /my-article#republish-modal might make more sense in terms of separation-of-concerns, so that we don't need to add query string handling on the server side for something that only has an effect on the client side.

For my use case at least, it doesn't matter. I agree it'd be nice not to bother the server with it, but also it seems like this functionality is not JavaScript-dependent? Like if it was just toggling the class on the server side, it seems like it would then work even if JavaScript was not enabled or if it broke?