-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Block Library - Query Loop]: Honour intended post type when previewing patterns and when replacing with patterns #43285
Conversation
Size Change: +160 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
From a design perspective my feeling is that the previews lose their effectiveness if they aren't accurate. It's still worth landing this as it fixes a bug, but it would be good to look into contextual previews soon after. |
564266c
to
6711308
Compare
6711308
to
ec6de9f
Compare
@jameskoster I made the previews based on the current post type as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Nik, that's much better. It highlights the need to posttype-based pattern categories / query block variations, but for now I think we can merge this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, makes sense. :)
Before merging I recommend renaming the title of this PR, which is a bit vague. Maybe something along the lines "Honour intended post type when previewing Query Loop setups".
What?
Part of: #42533
From the issue:
How?
This PR doesn't explore some generic solution(we might not even need one) as Query Loop is quite complex and I think it's okay to have some specific handling to accommodate this, and also become a lot more flexible and open to extension by third parties in the future.
In the pattern setup and replace flow, and the block variations(
scope
) flow I'm updating the Query Loop blocks to be inserted by retaining the existingquery.postType
andquery.inherit
options. These two properties are fundamental for the expected functionality of the block and don't affect its design and presentation.What this means in practice is that if we have a Query Loop with
postType: product
and choose toreplace
with another patterns(we want to update the design), thepostType and inherit
properties will be retained.Testing Instructions
Replace flow
postType
to anything thanpost
, as is the one used by most patterns.replace
in block toolbar and select another patternpostType and inherit
are retained.Scope block variations
page
) to the Posts List (inserter) variation here.Posts List
block and choosestart blank
.postType
is retainedScreenshots or screencast
Screen.Recording.2022-08-19.at.3.40.05.PM.mov