-
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
Query block: Expose initial templates as block variations #26378
Conversation
Size Change: +573 B (0%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
Hey @ntsekouras, thanks for getting this PR underway! I took a screenshot of what I'm seeing, and sharing it as a visual representation of where this PR is currently. I know the icons are just placeholders right now, so I went ahead and created some of the other SVGs so you can use those instead. Screenshot Title & DateSVG
Title & ExcerptSVG
Title, Date & ExcerptSVG
Title & ContentSVG
|
Thanks @mapk ! I've added them and looks nice :) Do you think we should make one more variation to start with including |
I really want to include at least one with featured image. We can remove some of the others if necessary. |
I don't think these icons math the general visual flair of our icons super well, but let's merge this as a start anyways. We can also continue to refine the specific templates offered further. Another thing that comes to mind is that instead of a series of bundles we could offer the user to customize with checkboxes like:
(This is just a thought to consider and should not block this PR.) |
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.
Great one. I'm glad it works without too many hassles by replicating the Columns block. I left some comments but I don't consider them blockers.
I tested new behavior and it all works as expected, including proper initialization after page reload.
@@ -75,4 +76,17 @@ export default function QueryEdit( { | |||
); | |||
} | |||
|
|||
const QueryEdit = ( props ) => { | |||
const { clientId } = props; | |||
const hasInnerBlocks = useSelect( |
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.
I'm surprised it works out of the box when replicated from Columns block. Let's see if this is something that could be further abstracted as proposed in #20582.
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.
Yes, I agree with that and saw that some logic might be extracted, but I think it's better for a follow up.
Another thing I wanted to wait before looking into this, is that for Query the Placeholder
will be probably be a steps
init block procedure. At first select some 'layout
(still block variation technically) of the block and then a second step to select some other block options. So I'd like how this could work and be abstracted for other blocks as well.
I'd like to have the icons limited to 34px in width (just like the Columns block) while the button itself remains at 48px before this gets merged. The result should look like this. @ntsekouras, I remember you mentioning that the grid formation with the featured image doesn't work right now, so I can get you another icon that just shows the featured image stacked on top of the other text. |
@ntsekouras here is an SVG for the featured image option. Title, Date & Featured ImageSVG
|
@mtias I'm happy to iterate on icons. Currently, their width should match the Columns icons and be limited to 34px. Both Column layout choices and Query layout choices would then still remain wider than the rest of our icons which are set at 24px, mostly. |
18e9d56
to
9e98251
Compare
84ead53
to
89e5d2e
Compare
Description
Resolves: #26194
This PR expose initial templates like
Title and Excerpt
,Title and Featured Image
as block variations of theQuery
block.For now it uses the
Placeholder
pattern likeColumns
and these variations are not exposed in the inserter.Checklist: