-
Notifications
You must be signed in to change notification settings - Fork 1
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
Filtered Query Block #18
Comments
👋 I've looked a bit into this today, from a "progressive enhancement" angle. I'd think of the role of the Filtered Query block as something that simply renders a bunch of The client-side navigation is the "enhancement" part -- it can be added to intercept any clicks on navigation links and turn them into client-side transitions instead. The good news is, most of the pieces should be available already! As it happens, the Query Loop block has a toggle called "Force Page reload" that's enabled by default. Disabling it will cause it to use client-side navigation instead! As a bonus, we then get pagination etc. for free from the Query Loop block. The bad news is, there's a number of limitations to this. The toggle is wired such that it can't be disabled if there are any blocks present that are known to interfere with client-side navigation (i.e. any block that doesn't have block-support set for This might still cover a decent number of use cases, but it won't work e.g. for a video archive template where each post object contains a Youtube embed that's supposed to be shown in the archive. As a work-around for this latter case, one might need to get creative and e.g. use a post meta to set the Youtube video URL, and have the template display it via Block Bindings. Furthermore, in addition to the "hard" requirement of blocks being compatible with client-side navigation, there's also some heuristics run on the frontend that determines if there are any other things that might interfere with client-side navigation, and will disable it if that's the case. In practice, I seem to keep running into that, so I'll need to ask my more Interactivity-API-savvy teammates how to track down the reason 😅 |
@luisherranz kindly helped me figure this out. In short, we only support region-based (rather than full-page) client-side navigation for now, which means that it's only the contents of the Query Loop block that are being updated. This means that clicking on pagination links triggers client-side navigation; clicking on individual items in the archive list doesn't (as they'd point to a different page). The good news is that it should be fairly straight-forward to make this work with the Categories List block (or any similar block inspired by it) 😄 Here's a PoC: |
Overview
This block should extend the existing Query Loop block by adding a list of categories above the posts.
Scope
Functionality outline:
Settings/Options
<span>
)Layout options
Styling
Architecture
How the block architecture might make sense; this way the filters and Query Loop layout are separate pieces, easier to make custom layouts:
Front end examples
From this Figma page.
Styling
Layouts
The text was updated successfully, but these errors were encountered: