Conversation
If the query block is part of a template we should consider whether it's a template for a category.
|
Size Change: +3.92 kB (0%) Total Size: 1.25 MB
ℹ️ View Unchanged
|
| const categoryIds = categories | ||
| ?.filter( ( { slug } ) => slug === targetSlug ) | ||
| .map( ( { id } ) => id ); | ||
| query.taxQuery = { |
There was a problem hiding this comment.
This is useful, though we need to make it so any taxonomy works by default. I'm thinking on tags but also any 3rd party taxonomies (e.g.: product categories that Woo uses, etc).
jameskoster
left a comment
There was a problem hiding this comment.
Thanks for working on this, it's behaving as expected from a UX perspective, so I'm approving on that account.
It would be nice to do something similar with the Archive Title block as a follow-up, since this is a bit sub-optimal 😅
Something else we'll need to think about soon: As we implement this behaviour for other templates (taxonomies, specific posts / pages, etc), it seems reasonable that users will expect to fluidly move between editing template/content. At the moment Queries are locked.
I don't think direct manipulation is the way to go (there still needs to be some friction), but I think some more design exploration is warranted. Perhaps something like #43608 can inform the direction. cc @jasmussen.
|
You're referring to the fact that you see real content, but you cannot (or should not) edit it? Yes, I think there needs to be some indication that it is shown but not meant to be editable. Outside of bigger click-through layers and edit buttons, we could potentially — judiciuosly — apply |
In this circumstance it's probably fine to make it editable (maybe even by direct manipulation, I shouldn't be so hasty). But at the moment it is not at all which feels a bit awkward. If you see a typo you need to go all the way to the post editor to fix it.
Absolutely. I was mostly connecting a dot, and hopefully trying to get ahead of something that I anticipate will be requested fairly soon after these features are merged. |

What
This PR makes the post template block to load only the posts from a specific category when the 1) the query block is set to inherit the filters from the template and 2) the user is editing the template of a specific category.
Why
We want to present the users with the contextual data they're editing. Part of #41947
How?
This PR continues the work started at #27128 (allow query to inherit from template) and #27972 (introduce
templateSlugdata to decouple from edit-site).It inspects the value of the existing
templateSlugand if it'scategory-<slug>it uses that info to prepare the query.Testing Instructions
Gravacao.de.ecra.a.partir.de.30-08-2022.12.13.24.webm