-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Query Loop Block: develop a content-only representation #66614
Comments
What about surfacing alternate designs, like here: #63497, so you can essentially swap out blog designs. We already have "Replace" in the toolbar. |
I like that, and it pairs well with the fact that the loop placeholder block also allows you to pick from those options. |
Let's try that to start, before surfacing additional controls in write mode. |
I attached this issue to the audit tracking issue: |
Happy to open this as a separate issues if we need it but I wanted to note that it's also really frustrating right now where if you swap between certain patterns in the query loop block, you suddenly can't see the "replace" option in the toolbar: no.longer.can.replace.patterns.movThis is using TT5 with GB 19.8. |
🤔 It looks like the query loops is being replaced by a pattern with no content blocks (??) So selecting the pattern is only selecting its container block. If you enter Design mode again, the query loop is inside the pattern. But when I add a group block with a query block inside it's also not accessible. Kapture.2024-12-10.at.13.22.49.mp4Does this mean query loops should always be accessible in write mode for the purposes of changing their designs? |
@talldan just pointed out to me the significance of the main section, which, according to the editor is the first container block (usually group) that has a tagName of The query block will only be shown as a child in Write mode when its inside a main section AND that main section is the first one in the tree. Kapture.2024-12-10.at.16.19.52.mp4Whether this is a useful constraint/intuitive design pattern is another discussion 😄 |
I've been looking at this one today, and have been hacking about. I found that if I gave the Query Block "query" attribute a role of "content" in block.json, the block will show in the list view, and therefore the block toolbar works. Let's ignore for a bit whether this is right or not 😄 The Change Design button won't show on nested Query Blocks, as it is considered the child of a section. The selector won't return any patterns. Here's the call stack in the block editor selectors file: getPatternsByBlockTypes() So for query blocks, the easiest way to get patterns all the time is to pretend that query block has no parents, and therefore is not nested in a pattern. This means calling getPatternsByBlockTypes() with no Kapture.2024-12-19.at.15.20.35.mp4There are some other inconsistencies, such as the drag dots and the context menu. Should these be there are at all I wonder? In my mind, dragging/copying/duplicating/deleting is design functionality. |
I was chatting with @talldan and one approach is to create a flag in the block metadata, e.g., |
In general I also believe a prop in Blocks API would be better than trying to add Having said that, the hard thing about trying to figure out how all blocks should behave in write/design mode is that the current mechanism relies on |
The naming might not be perfect. I think we need to try something and see how it works. I was mostly thinking about how it applies to the navigation block. That's what led me to thinking about Site Title / Tagline / Logo etc are a problem. #67372 does make Title and Logo work via There was a suggestion on that PR to make Template Parts work exactly like Synced Patterns where all the content is locked (even blocks with |
I won't pretend I have all the issues covered, but on that specific point: forgetting about what the prop is called for a moment, it could be an object for more flexibility in describing its behaviour. Plus, if it's private and not part of the block.json schema it gives some breathing room to test and iterate. |
Exploratory PR over here for discussion purposes: |
Similar to #65699, we need to think about the experience of interacting with the Query Loop block when in Write mode/content only. As it stands right now, the experience is quite confusing as the only items you can edit or change when viewing a homepage aren't items most will need to change. For example, here's a video showing how in Write mode, the only piece you can edit is the no results message:
no.results.found.query.loop.content.only.mov
When testing this with loved ones (I can ask for permission to share some of the video), repeatedly folks would edit this text as it was the only thing offered to them to edit in much of the homepage! Similar to the navigation block, we need to find a way to open up some controls and options while also clarifying the current limitations to know when to switch into Design mode.
The text was updated successfully, but these errors were encountered: