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

Gateway skeleton: Search function

Started by Muut Archive 9 years ago · 6 replies · 511 views
9 years ago

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?

9 years ago

Spoke too soon. Now the categories doesn't work. It needs the 'blog/' to return a hit.
‘domain.com/blog/category:text’

9 years ago

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>'

9 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1346 9 years ago
Archive · by Muut Archive, 9 years ago
2 933 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago