New Blocks not showing in Widget Block Search

Support MB Blocks New Blocks not showing in Widget Block SearchResolved

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33463
    mark@olypress.com[email protected]
    Participant

    I created several blocks a few months ago and they all worked well.

    Today I went to create a new block, but it will not show up in the widget block search.
    https://ibb.co/YQJQYpG

    All older blocks are showing up, and the new block also shows up in the posts/page editor when I search for it. See: Olyweb Quicklink Block shows in the post search.
    https://ibb.co/gP6QJpx

    I have tried duplicating older blocks (changing the name and slug), and they will not register in the widget block search either.

    #33464
    mark@olypress.com[email protected]
    Participant

    Here is a generated function from MB Builder

    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'           => __( 'Olyweb Quicklink Block', 'your-text-domain' ),
            'id'              => 'olyweb-quicklink-block',
            'icon'            => 'grid-view',
            'category'        => 'oly-blocks',
            'supports'        => [
                'align' => [''],
            ],
            'render_callback' => 'nb_quick_blocks',
            'enqueue_assets'  => 'olytheme_scripts',
            'type'            => 'block',
            'context'         => 'content',
            'preview'         => [
                [
                    'on' => '',
                ],
            ],
            'fields'          => [
                [
                    'name'          => __( 'Background Color', 'your-text-domain' ),
                    'id'            => $prefix . 'bg_color',
                    'type'          => 'color',
                    'alpha_channel' => true,
                ],
                [
                    'name'          => __( 'Font Color', 'your-text-domain' ),
                    'id'            => $prefix . 'font_color',
                    'type'          => 'color',
                    'alpha_channel' => true,
                ],
                [
                    'name'        => __( 'Blocks', 'your-text-domain' ),
                    'id'          => $prefix . 'quick_blocks',
                    'type'        => 'group',
                    'collapsible' => true,
                    'group_title' => '{quick_block_title}',
                    'clone'       => true,
                    'sort_clone'  => true,
                    'max_clone'   => 8,
                    'fields'      => [
                        [
                            'name'       => __( 'Image', 'your-text-domain' ),
                            'id'         => $prefix . 'quick_block_img',
                            'type'       => 'single_image',
                            'image_size' => 'medium',
                        ],
                        [
                            'name' => __( 'Title', 'your-text-domain' ),
                            'id'   => $prefix . 'quick_block_title',
                            'type' => 'text',
                        ],
                        [
                            'name'        => __( 'URL', 'your-text-domain' ),
                            'id'          => $prefix . 'quick_block_url',
                            'type'        => 'text',
                            'desc'        => __( 'include http://', 'your-text-domain' ),
                            'placeholder' => __( 'http://site.com', 'your-text-domain' ),
                        ],
                    ],
                ],
            ],
        ];
    
        return $meta_boxes;
    }
    #33465
    mark@olypress.com[email protected]
    Participant

    Even tried a simple test block, and it will not show up in the widget search either

     $meta_boxes[] = [
            'title'       => __( 'Test Block', 'your-text-domain' ),
            'id'          => 'test-block',
            'description' => 'Test',
            'icon'        => [
                'background' => '#81d742',
                'foreground' => '#eeee22',
                'src'        => 'admin-appearance',
            ],
            'category'    => 'text',
            'keywords'    => ['test'],
            'supports'    => [
                'align' => [''],
            ],
            'type'        => 'block',
            'context'     => 'content',
            'fields'      => [
                [
                    'name' => __( 'Button', 'your-text-domain' ),
                    'id'   => $prefix . 'button_ps918i97tzm',
                    'type' => 'button',
                ],
            ],
        ];
    
    #33466
    mark@olypress.com[email protected]
    Participant

    I think I found that this is some conflict with PUBLISHPRESS BLOCKS Plugin. When deactivated the blocks show up in the widget search.

    #33467
    mark@olypress.com[email protected]
    Participant

    The last problem seemed to be that the widget block search only shows a certain amount of blocks.

    I did find a new problem. When adding a block made with MB on the Widget Page the MB js/css is not included like file.css/js color.css/js group.css/js .... ect doe

    https://ibb.co/5kG4G7T

    #33474
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thanks for your feedback.

    The script files of MB Blocks only load on the post editing page. I will inform the development team to support it on the widget editing page.

    #33490
    mark@olypress.com[email protected]
    Participant

    Thanks, Long.

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