Improvement in Search Box in Deliver Theme

Hi there.

I’ve noticed that in search box of Deliver Theme, if you do any search the results are showed fine only with the upper search box (right of menu). Meanwhile, if you do the same search in the sidebar of blog page, it shows an error 404.

I suggest splitting question and answer to separate posts and mark answer as a solution :wink:

1 Like

SOLUTION:

Change in your Child Theme, the following files:

In partials/search.html.twig

line 2:

<input type="search" placeholder="Search..." value="{{ query }}" data-search-input="{{ base_url_relative }}{{ config.plugins.simplesearch.route}}/query" />

Change base_url_relative to base_url_absolute

In partials/simplesearch_searchbox.html.twig

line 15:

data-search-input="{{ base_url }}{{ config.plugins.simplesearch.route == '@self' ? '' : (config.plugins.simplesearch.route == '/' ? '' : config.plugins.simplesearch.route) }}/query"

Change base_url to base_url_absolute.

With this changes your searchbox will allways work fine.

I hope have helped.