You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there,
I noticed one thing that on other sites works well, but somehow on my project (Eleventy + Nunjucks) is not working as expected.
I have 1 search page and different page for blogs. When I start to search on my search page I type some word, results show OK, now I click on some result, it redirects me to the correct URL, e. g. blog post.
But here starts the problem.
When I want to go back to search page by clicking on "step back" arrow in browser, my results are not visible anymore, but searched query in input is still there. Which is interesting, only the results missing.
When I start to type again, it works normally like at the beginning.
Has someone similar issue?
Thank you for your response.
By the way, very good job about the whole library.
OS: Windows 10, Browser: Google Chrome, Firefox, latest version of Eleventy 3.0.0, latest Pagefind 1.2.0
The text was updated successfully, but these errors were encountered:
slivos
changed the title
Lost search results when navigating back - Eleventy + Nunjucks
Lost search results when navigating back / Eleventy + Nunjucks
Dec 1, 2024
OK I found nice solution on issue #588, thank you.
Now in my init script it looks like this:
window.addEventListener("DOMContentLoaded",(event)=>{constparams=newURLSearchParams(window.location.search);constsearchUI=newPagefindUI({element: "#search",showImages: false,pageSize: 10,translations: {placeholder: "Hľadať v článkoch",zero_results: "Nenašlo sa pre [SEARCH_TERM]",},processTerm: function(term){history.replaceState({},"",`?q=${encodeURIComponent(term)}`);returnterm;},});if(params.has("q")){searchUI.triggerSearch(params.get("q"));}});
Hello there,
I noticed one thing that on other sites works well, but somehow on my project (Eleventy + Nunjucks) is not working as expected.
I have 1 search page and different page for blogs. When I start to search on my search page I type some word, results show OK, now I click on some result, it redirects me to the correct URL, e. g. blog post.
But here starts the problem.
When I want to go back to search page by clicking on "step back" arrow in browser, my results are not visible anymore, but searched query in input is still there. Which is interesting, only the results missing.
When I start to type again, it works normally like at the beginning.
Has someone similar issue?
Thank you for your response.
By the way, very good job about the whole library.
OS: Windows 10, Browser: Google Chrome, Firefox, latest version of Eleventy 3.0.0, latest Pagefind 1.2.0
The text was updated successfully, but these errors were encountered: