-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Self-controlled search page doesn't actually search #51
Comments
On it |
@hunternet93 replicated. Can you test this PR #53 ? Thanks! |
The PR works great, thanks! |
Ok cool! Merging it |
Hi! I have the same problem: on my local grav site, and on the grav skeleton mentionned by hunternet93 (I downloaded it, added the exact array in the frontmatter, and searched for a word), the self-controlled search does not update the page. I did some tracing in the code (in onPagesInitialized function), and the collection is indeed reduced to only the pages that correspond to the searched terms, but the page itself is not changed. I take it that Do you know how I can fix that? (I can give a archive of my user folder, for you to see my config & dumps in the simplesearch code) Is there an specific order to follow in the frontmatter? Thanks in advance! |
Excuse me, was it an error to "up" this issue? Do I have to create a new one? |
I merged the change but was reverted, as was breaking some functionality. You need to make sure the blog page (in Antimatter) fetches the collection from the search result. This line: /~https://github.com/getgrav/grav-theme-antimatter/blob/develop/templates/blog.html.twig#L3 Change it to Need to add this to the docs. |
That was… simple. I'm a bit ashamed I didn't think of that. Thanks! |
Actually the docs say that it should work out of the box, something seems to miss, need to dig a little bit this use case. |
I got the same problem, but it even does not work conditionally setting the collection? Anybody else having trubles? The docs do not mention this detail. Has there ever been a fix for that? |
I'm trying to set up a per-page search feature as described here, however when searching the template simply renders the same page, instead of filtering content by the search query.
Steps to reproduce:
Download and extract the blog site skeleton. I'm using PHP's built-in webserver for testing, but I've also tried Apache with identical results.
Edit the file
user/pages/01.blog/blog.md
and append the following to its frontmatter:Open the site in a browser and attempt searching. Searching will redirect the page to /blog/query: as expected, but then will load exactly the same page again, without filtering by the search query.
Did I miss a step when setting up simplesearch?
The text was updated successfully, but these errors were encountered: