• Resolved Haldan

    (@hblecher)


    Hi again Anders,

    Just wondering whether you know if the search widget works in Tove? I’ve managed to work with it to the extent it now looks right, but it doesn’t actually return any results when I use it (it just returns the homepage when used). I know search is often tripped up by query blocks so I wondered if you’d seen it ever work in action in Tove.

    You can find the search bar at the bottom of the linked page.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi @hblecher,

    I believe the search, queries and template routing for search is one of those areas where the kinks are still being worked out in the Gutenberg plugin. Block themes doesn’t interact with those parts of Full Site Editing directly – they just provide a index.html template file telling WordPress how to output the blocks on the results page. I did a quick test in my development environment, and the results look the same in Tove as they do in Twenty Twenty-Two (the upcoming FSE default theme).

    — Anders

    Thread Starter Haldan

    (@hblecher)

    Thanks Anders. So just to be clear, your experience is that search doesn’t yet work in Tove correctly because Gutenberg has yet to work out the kinks?

    Theme Author Anders Norén

    (@anlino)

    @hblecher Yeah, that seems to be the case in my local environment.

    Thread Starter Haldan

    (@hblecher)

    Aha thanks. Do you know if there are any wp search plugins that work with Gutenberg & Tove? I’ll experiment to see if I can find one. Thanks again.

    • This reply was modified 4 years, 7 months ago by Haldan.
    Theme Author Anders Norén

    (@anlino)

    @hblecher I don’t, unfortunately. But hopefully the Core search will work as expected by the time 5.9 is released.

    Thread Starter Haldan

    (@hblecher)

    Similar issue, so I thought I’d post it here instead of making a new thread. Do you know if the Archives function of the query loop also doesn’t work? I’m wondering if it suffers from the same issue that the search function does, if perhaps the issue lies in rendering a select group of posts in the query. You can see at the bottom of the page I have an option to display archives by month, but when you click on them, it just returns the homepage–instead of the archived posts.

    Thread Starter Haldan

    (@hblecher)

    Update: I managed to get both the archive and search to work — I had to set the query loop to “inherit query from template.”

    This is a nice step in the right direction, but now I’m not sure how to customize the query in the ways I need. For instance, I need to show more than the most recent 10 posts on the homepage. I’d also like to be able to filter the query by category, etc. Do you know how I can accomplish this while still using the “inherit query from template”? I could start editing the theme files, but I’m hesitant to do that since you’re regularly updating things. Please do let me know when you have a chance!

    Thanks.

    Thread Starter Haldan

    (@hblecher)

    Another update: I think I figured out how this kind of customization is intended to work. I edited the index template manually to include 21 posts in the query, instead of 10, but that hasn’t seemed to work. It’s still showing only 10 posts on the main page. Strange quirk though, inside the site editor it shows a preview of 21 posts–but it doesn’t render that way when published.

    I’ve also asked this question on the Gutenberg forum, but if you have any insight, or if you suspect this may be a Tove issue, please do reply. Thanks.

    Thread Starter Haldan

    (@hblecher)

    Final update: well, I feel a little dumb. After hours of trying to google what the global query context refers to, and digging through the Gutenberg and Tove code, it turns out “inherit query from template” is a misnomer. It doesn’t inherit the query settings from the currently used template (which makes sense, since the query loop block likely lives on the template page itself anyway). If you have this toggle enabled, worpress will ignore any other settings you hard code in the template. What this actually refers to is the global WordPress “Reading” settings in the dashboard. It’s been so long since I bothered to think about those settings, I had forgotten all about them. On this settings screen, it was a simple task to just change the number of posts shown on the home page from 10 to the desired number 21. Easy peasy.

    It seems like a real oversight for Gutenberg to use this verbiage, and I’m comforted to know I’m not the only person who has totally misunderstood this. Hopefully this is corrected in future Gutenberg updates, and as importantly, I hope that Gutenberg folks figure out a way to either (a) keep the toggle enabled but offer a way to limit posts in the query by category, etc., or (b) find a way to get search and archive to work within the custom query loop. (or both)

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Search widget?’ is closed to new replies.