Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Improvement in Search Box in Deliver Theme

Solved by Pedro M View solution

Started by Pedro M 5 years ago · 2 replies · 477 views
5 years ago

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.

last edited 02/01/21 by Pedro M
5 years ago

I suggest splitting question and answer to separate posts and mark answer as a solution ;)

👍 1
5 years ago Solution

SOLUTION:

Change in your Child Theme, the following files:

In partials/search.html.twig

line 2:

TWIG
<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:

TWIG
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.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 202 2 months ago
Themes & Styling · by Ian, 2 months ago
3 98 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 461 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 52 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 132 3 months ago