Block doesn't render on editor unless I fill some field data
- This topic has 11 replies, 9 voices, and was last updated 2 years ago by
David McGinty.
-
AuthorPosts
-
April 7, 2022 at 2:25 PM #35511
Attachmedia SAC
ParticipantI created a block to display a custom data I fetch from the DB, I don't need customization (fields) for this blocks. But in the editor doesn't render de template unless there is a field and the field is filled.
add_filter( 'rwmb_meta_boxes', function ( $meta_boxes ) { $meta_boxes[] = [ 'title' => 'My Block' , 'id' => 'my-block' , 'type' => 'block' , 'mode' => 'preview' , 'render_callback' => function () { echo '<h1>My Block</h1>'; }, ]; return $meta_boxes; });I have set
mode=preview. What am I missing?April 8, 2022 at 11:27 AM #35528Long Nguyen
ModeratorHi,
The extension MB Blocks only support rendering the block if it has at least one custom field. I will inform the development team to consider supporting this case.
April 9, 2022 at 1:36 AM #35542Attachmedia SAC
ParticipantThat would be great. Thank you.
May 9, 2022 at 10:46 PM #35966Cereal Concept
ParticipantHi !
Do you have news on this ?
I'm using InnerBlocks and sometime I don't need fields. I'm using MB Block to wrap code around gutenberg content.Thanks
JohannJune 17, 2022 at 10:49 PM #36554metafan
ParticipantI need this feature too.
Rendering some html-only block without triggering a custom field.Any news?
Thanks!June 20, 2022 at 6:03 PM #36589Cédric Dagherir
ParticipantHi ! Thanks for your whole work 🙂
I need this feature too. Thanks.
September 2, 2022 at 11:53 PM #38162Greg
ParticipantI would also like the block to render even if there are no custom fields. It does not make any sense to tell the user, "Click the Edit icon in the block toolbar to enter content" if there are no fields to fill out.
My block does technically have a "field" in the list of Fields in Edit Field Group, but it is just Custom HTML that explains the block has no settings. It still renders in the editor with the "Click the Edit icon" message.
September 9, 2022 at 9:13 PM #38249Julien
ParticipantI need this feature too.
Any news ?
February 9, 2023 at 8:11 PM #40461Cédric Dagherir
ParticipantHi !
Did you integrate or plan to integrate this feature ?
Thanks
February 10, 2023 at 7:10 PM #40476metafan
ParticipantMust have for good UX!!
Any news?
ThanksMarch 11, 2023 at 11:58 PM #40958Dave
ParticipantI can think of use cases for this, is it implemented now?
March 13, 2024 at 7:03 PM #44831David McGinty
ParticipantI would want this feature added as well. I have a spacer block, sometimes it takes classes but i'd like it to render on the page editor even if the user doesn't pass any data to the fields.
-
AuthorPosts
- You must be logged in to reply to this topic.