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

SimpleSearch (Self-Controlled Search Page)

Started by Muut Archive 9 years ago · 5 replies · 834 views
9 years ago

For whatever reason I can't seem to get the https://github.com/getgrav/grav-plugin-simplesearch#2-self-controlled-search-page option to replace the page collection with search results. I've followed all the instructions without luck.

I.e, I have a blog.md, listing a couple of children blog items:

YAML

title: blog

simplesearch:
    route: /blog
    filters:
        - @self

content:
    items: @self.children
    order:
        by: date
        dir: desc

The search bar is included with {% include 'partials/simplesearch_searchbox.html.twig' %}

Now whenever I do a search on this page (blog.md), it routes to the same page resulting in ./blog/query:mysearchstring

That's all good, however listed blog items on the page remains the same. If I understand the doc correctly, it should replace the page collection with items from the search results?

I've tried with and without category filters in /plugins/simplesearch/simplesearch.yamlto no avail.

Side question: Is there any way to get this plugin to perform live search as query is typed?

Cheers!

9 years ago

btw changing from

YAML
simplesearch:
    route: /blog

to

YAML
simplesearch:
    route: @self

leaves me with

Server_error

Doesn't look like this (Common/..) directory exists.

9 years ago

Let me look into this :). I can do so tomorrow.

9 years ago

I just looked over your example, it looks ok at first reading. I think i'm going to have to try to replicate your exact setup. We are using this for the getgrav.org blog site, so I know it works, and I looked at the code, and it looks very similar to yours, so not sure what the problem is.

9 years ago

I think I have the exact same problem! Any help would be greatly appreciated!

9 years ago

Ok, I think I misunderstood this paragraph about the self-controlled page. I expected it to provide an isotope-like filter capability (live update) out of the box, just like in the /downloads/themes or /downloads/skeletons/ pages of getgrav. Guess I have to find another solution!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1333 9 years ago
Archive · by Muut Archive, 9 years ago
2 924 9 years ago
Archive · by Muut Archive, 9 years ago
2 4055 9 years ago
Archive · by Muut Archive, 9 years ago
1 2933 9 years ago
Archive · by Muut Archive, 9 years ago
3 1110 9 years ago