Open olivierdalang opened 7 years ago
Perhaps have a look at @flaviocopes's reply to a similar question here.
I had a similar issue to the one you describe, with an almost identical page configuration to the example you give above.
I did as suggested in the answer, changing this line in my template to {% set collection = search_results ?: page.collection() %}
and it fixed the issue for me (thanks flaviocopes).
Hope that helps.
@timrobbings Thanks that did the trick ! I think this should be fixed to work out of the box or specified in the doc
Another problem once this is solved is the inability to clear the search. If you enter an empty string, you can't submit the query. I think a link should be added to clear the search if there is a query. Here's my quick fix :
in templates/partials/simplesearch_searchbox.html.twig
...
{% if query %}
<a href="{{page.url}}">Clear the search</a>
{% endif %}
...
{% set collection = search_results ?: page.collection() %}
This should totally be added to the docs, this issue was driving me nuts
Hi ! I tried to follow the instructions carefully, but couldn't make simplsearch work on page searches (global search works well).
Here's my code :
When submitting the form, the query is correctly appended to the url, but the listing page shows all the items, just as if no query was set. Is it a bug ?