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

No results are produced #183

Open
asimakos opened this issue Oct 30, 2019 · 6 comments
Open

No results are produced #183

asimakos opened this issue Oct 30, 2019 · 6 comments

Comments

@asimakos
Copy link

I have integrated the search bar with glass button into my custom theme and applied the following config to /user/config/plugins/simplesearch.yaml:

enabled: true
built_in_css: true
built_in_js: true
display_button: true
min_query_length: 3
route: /search
search_content: rendered
template: simplesearch_results
filters:
  category:
    - '@none'
filter_combinator: and
ignore_accented_characters: false
order:
  by: date
  dir: desc

Unfortunately when i search for a keyword it routes to http://myserver/?searchfield=energy results page is not routed properly and additionally it gives no results. I have also added simplesearch_results.html.twig into templates folder and simplesearch_searchbox.html.twig into templates/partials folder. Additionally i have not created any category or taxonomy at all in my blog! Any idea what i am missing?

Regards

@rascasse83
Copy link

same issue for me :-)

@rascasse83
Copy link

I fixed my issue with search not working, when embedded in a page (it worked on its own, but not when the form was embedded in a page).

Bear in mind my fix applies to the Gantry5 Framework & Hydrogen theme, but it might work for you.

The issue was that the Javascript was not loading.

I change the page.html.twig template to include this piece of code on line 65

{%- do gantry.document.addScript(url('/DxChange/user/plugins/simplesearch/js/simplesearch.js'), 11, 'footer') -%}

This results in the javascript being loaded in the HTML (check the code source) near the footer

<script src="/DxChange/user/plugins/simplesearch/js/simplesearch.js"></script>

Subsequently the search works ! Et voila :-)

@rascasse83
Copy link

PS: replace "DXChange" in the URL with your website name

@marcocevoli
Copy link

same issue here

@marcocevoli
Copy link

All suggested doesn't work. Reverting back to version 1.1.2 works.

@Grayches
Copy link

Futher to the below, without gantry, just add the below line to the base.html.twig so the js loads:
{% do assets.addJs('plugins://simplesearch/js/simplesearch.js', 98) %}

as below:
{% block bottom %}
{% do assets.addJs('theme://js/skel.min.js', 100) %}
{% do assets.addJs('theme://js/main.js', 99) %}
{% do assets.addJs('plugins://simplesearch/js/simplesearch.js', 98) %}
{% do assets.addJs('theme://js/util.js') %}
{{ assets.js() |raw}}
{% endblock %}

I fixed my issue with search not working, when embedded in a page (it worked on its own, but not when the form was embedded in a page).

Bear in mind my fix applies to the Gantry5 Framework & Hydrogen theme, but it might work for you.

The issue was that the Javascript was not loading.

I change the page.html.twig template to include this piece of code on line 65

{%- do gantry.document.addScript(url('/DxChange/user/plugins/simplesearch/js/simplesearch.js'), 11, 'footer') -%}

This results in the javascript being loaded in the HTML (check the code source) near the footer

<script src="/DxChange/user/plugins/simplesearch/js/simplesearch.js"></script>

Subsequently the search works ! Et voila :-)

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

No branches or pull requests

4 participants