I am using the Gateway skeleton theme and noticed the search function is not working correctly when I am in the blog page. I get an error while performing a search query. If I am in a different page(about, contact, home,etc), the search returns a match. The issue I am noticing is that the url should return
'domain.com/search/query:text'
instead it is returning
'domain.com/blog/search/query:text' which is a page not found.
Anyone knows how I can fix this?
I found the issue being in the Gateway theme, it was overwriting a variable in the blog / blog post twig: https://github.com/getgrav/grav-theme-gateway/commit/6981178eb81bdd1612fa0ecb745292d5280e55ed
If you download the latest Gateway theme package https://github.com/getgrav/grav-theme-gateway/archive/develop.zip you can try it, and confirm, then I'll make a release of the theme.
Hi flaviocopes,
Sorry for the late reply. I didn't redownload the gateway theme, but I did edited the files you have posted on a different thread and it works.
https://github.com/getgrav/grav-theme-gateway/commit/6981178eb81bdd1612fa0ecb745292d5280e55ed
Spoke too soon. Now the categories doesn't work. It needs the 'blog/' to return a hit.
‘domain.com/blog/category:text’
I have fixed the issue for category and tag links in the sidebar the way I know how. If there is a proper of doing it, please explain.
You will need to edit 2 files.
../partial/categorylist.html.twig
Find line containing '<li class="cat-item cat-item-{{ loop.index }}"><a href="{{ base_url }/category{{ config.system.param_sep }},{{ tax|e('url') }}">{{ tax|capitalize }}</a></li>'
Add '/blog' ,<li class="cat-item cat-item-{{ loop.index }}"><a href="{{ base_url }}/blog/category{{ config.system.param_sep }},{{ tax|e('url') }}">{{ tax|capitalize }}</a></li>,
../partial/taxonomylist.html.twg
Find line containg '<a href="{{ base_url }}/{{ taxonomy }},{{ config.system.param_sep }},{{ tax|e('url') }}">{{ tax|capitalize }} </a>'
Add '/blog', '<a href="{{ base_url }}/{{ 'BLOG'|t }}/{{ taxonomy }},{{ config.system.param_sep }},{{ tax|e('url') }}">{{ tax|capitalize }} </a>'
I verified that this theme v.1.2.0 add "/search" when it resolved. When you search it return http://www.drinkharder.com/home/blog/search/query:grav instead of http://www.drinkharder.com/home/blog/query:grav
@drinkharder
I am using the gateway skeleton theme. Yours is without the theme it appears. The search link url should not include the 'blog'. Have you followed @flaviocopes suggestion link and edit the 3 files. That should take care of the simplesearch.
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1346 | 9 years ago | ||
| 2 | 933 | 9 years ago | ||
| 2 | 4060 | 9 years ago | ||
| 1 | 2945 | 9 years ago | ||
| 3 | 1117 | 9 years ago |