Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement shareable URLs for Instant Results #2506

Closed
JakePT opened this issue Dec 9, 2021 · 1 comment · Fixed by #2604
Closed

Implement shareable URLs for Instant Results #2506

JakePT opened this issue Dec 9, 2021 · 1 comment · Fixed by #2604
Assignees
Milestone

Comments

@JakePT
Copy link
Contributor

JakePT commented Dec 9, 2021

Is your enhancement related to a problem? Please describe.

In its current state, it's not possible to share, bookmark or link directly to Instant Results search results. This is because the search results modal is triggered by an intercepted form submission and handled entirely in the client, and there's no ability to open Instant Results from the URL.

Describe the solution you'd like

Performing searches in the Instant Results modal should update the URL in the browser's address bar. This will allow users to share or bookmark the URL for a particular set of results. Consequently, visiting these URLs needs to automatically open the Instant Results modal with the search term, pagination and filters pulled from the URL and pre-populated.

With this behaviour in place it would also make sense to implement the browser history APIs so that the user can navigate backwards and forwards between search queries and pagination. It would also make sense if going backwards or forwards would also open or close the modal. This would also update the URL.

One challenge would be naming the URL parameters so that they do not interfere with any core URL parameters, leading to WordPress returning a 404 status. It may also be desirable for the resulting URL to perform a matching search within WordPress, so that if JavaScript is disabled, or of Instant Results has since been disabled, the URL performs some of its functionality.

@JakePT JakePT added this to the 4.0.0 (beta 2) milestone Dec 9, 2021
@JakePT JakePT self-assigned this Dec 9, 2021
@JakePT JakePT linked a pull request Feb 22, 2022 that will close this issue
6 tasks
@felipeelia
Copy link
Member

Closed by #2604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants