NEW! Rename Gutenberg Group Blocks in WordPress
Vložit
- čas přidán 5. 09. 2023
- Gutenberg 16.7 is on the horizon, and this new feature is brilliant! Ever felt lost in complex layouts using the group block? Well, now, you can name your sections like 'Feature Banner' or 'Meet the Team' in the ListView. Check out this demo! 👀
Coming in Gutenberg 16.7 on September 11th! Stay tuned for more updates!
Such a useful feature! Like you I've used groups so much so this will help me so much. Thanks for highlighting it!
My pleasure! A small but very significant and beneficial feature IMO 👍
Great!
Just watched a video of someone building with Generate Blocks, and they were able to name their "Container" block, so it's wonderful to see this functionality coming to the core "Group" block.
Yup! I couldn’t agree more 👍
Thanks so much for this. ❤
No problem 😊
Truly nice content! =DD
Thank you so much 🙏
After I rename my group blocks, and update the page and then log out, when I log in again, everything is back to the generic "Group". Is there a trick to preserving the new group names?
Hmm, thats really odd, having used this functionality for a while and just testing your steps, I can't seem to replicate it, I would suggest perhaps switching your theme or perhaps disabling plugins and running some tests just to rule out if there is a possible conflict.
I was trying to find the other day among their docs if it's possible to define Name for Group Block when creating Block Templates on a code level. But couldn't find indications for such Props :(
Not sure I follow, can you give more context or a particular scenario? I’d love to help, maybe I could follow up with a video 😇
@@elliottrichmondwp maybe this link to Gutenberg Documentation would explain better than me :) Hopefully, youtube won't delete it.
Once registering a Blocks Template one can define default properties for a blocks (depending what is available for a particular block in question). Like placeholder values, alignment etc.
(Section Custom Post Types as an example):
.....developer.wordpress.org/block-editor/reference-guides/block-api/block-templates/#custom-post-types
So I couldn't find in documentation such property that would allow me to programmatically define what would be a name for a specific group block when creating new template / pattern etc. The only option is to manually change the name once working directly in Gutenberg Visual Editor
@@elliottrichmondwp youtube doesn't allow me to paste here the link to Block Editor Documentation on Templates.
Basically when registering new template that can consist of various blocks one can define different default properties, depending what properties are available for a particular block. For instance, placeholder values or default alignment etc.
'template' => array(
array( 'core/image', array(
'align' => 'left',
) ),
array( 'core/heading', array(
'placeholder' => 'Add Author...',
) ),
array( 'core/paragraph', array(
'placeholder' => 'Add Description...',
) ),
),
So I couldn't find any reference in the documentation that would allow now to define default List View name for a particular group block when building such templates programmatically