Preview from block list doesn't work ?

Support MB Blocks Preview from block list doesn't work ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #47639
    JulienJulien
    Participant

    Hi,

    I use MB Blocks since 2 years now but I never take the time to check the "preview" on the sidebar of Gutenberg because my clients don't want to view something.

    But today, one of them ask to me to have previews on their own blocks but I don't understand how it's working (maybe it doesn't work ?)

    Sample code

    add_filter('rwmb_meta_boxes', function ($meta_boxes) {
    
        $meta_boxes[] = [
            'title' => 'Hello World',
            'id' => 'hello-world',
            'description' => 'This is a hello world block',
            'type' => 'block',
            'preview' => [
                'title' => 'My Hello World',
            ],
            'fields' => [
                [
                    'name' => 'Title',
                    'id' => 'title',
                    'type' => 'text',
                ]
            ],
            'render_callback' => function ($attributes, $content, $block, $is_preview) {
                echo $attributes['title'];
            },
        ];
    
        return $meta_boxes;
    });

    The result on Gutenberg on my side

    PHP: 8.2
    Wordpress version: 6.7.1
    Meta-Box: 5.10.6
    Meta-Box-Aio: 1.31.1

    #47640
    JulienJulien
    Participant

    Additional informations

    I tried with block.json system, same issue.

    #47650
    PeterPeter
    Moderator

    Hello Julien,

    Thank you for your feedback.

    There is an issue with the block preview and I've escalated this to the development team to fix it. I will get back to you when I have more information.

    #47840
    JulienJulien
    Participant

    Hello,

    do you have news ?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.