Configuring WYSIWYG Buttons not working

Support MB Blocks Configuring WYSIWYG Buttons not workingResolved

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #19723
    Rebecca RossiRebecca Rossi
    Participant

    So using a the WYSIWYG in a block and trying to pass button settings doesnt work

    'options' => array(
                            'tinymce' => array(
                                'toolbar1' => 'bold, italic',
                                'toolbar2' => '',
                            ),
                        ),

    In the end im trying to get the Format Select Dropdown to show because its not showing for me at all .

    #19728
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Could you please share full the code to create the field WYSIWYG? I will copy your code and check on my end.

    Here is my sample code

    function your_prefix_get_meta_box( $meta_boxes ) {
        $prefix = 'prefix-';
    
        $meta_boxes[] = array(
            'id' => 'untitled',
            'title' => esc_html__( 'Untitled Metabox', 'metabox-online-generator' ),
            'post_types' => array('post', 'page' ),
            'context' => 'advanced',
            'priority' => 'default',
            'autosave' => 'false',
            'fields' => array(
                array(
                    'id' => $prefix . 'wysiwyg_1',
                    'name' => esc_html__( 'WYSIWYG', 'metabox-online-generator' ),
                    'type' => 'wysiwyg',
                    'options' => array(
                        'tinymce'       => array(
                            'toolbar1'      => 'bold,italic',
                            'toolbar2'      => '',
                            'toolbar3'      => '',
                        ),
                    ),
                ),
            ),
        );
    
        return $meta_boxes;
    }
    add_filter( 'rwmb_meta_boxes', 'your_prefix_get_meta_box' );

    and it works as well https://share.getcloudapp.com/rRu9xWm1.

    #19736
    Rebecca RossiRebecca Rossi
    Participant
    public function mjmc_block_half_video_half_text($meta_boxes) {
    
            $meta_boxes[] = [
                'title'           => 'Half Video/Half Text',
                'id'              => 'half-video-half-text-content',
                'description'     => 'creates a block with 50% Video / 50% Text',
                'type'            => 'block',
                'icon'            => 'awards',
                'category'        => 'howell-blocks',
                //'context'         => 'side',
                'render_callback' => 'mjmc_block_half_video_half_text_render',
                //'enqueue_style'   => get_template_directory_uri() . '/blocks/hero/style.css',
                'supports' => [
                    'align' => ['full'],
                    'anchor' => true,
                    'customClassName' => true,
                ],
        
                // Block fields.
                'fields'          => [
                    [
                        'type' => 'color',
                        'id'   => 'background_color',
                        'name' => 'Background Color',
                        'js_options'    => array(
                            'palettes' => array( '#004B87', '#FFC629', '#F3F3F3','#FF6B00', '#005CAB', '#3DAE2B')
                        ),
                    ],
                    [
                        'type'  => 'text',
                        'id'    => 'video_iframe',
                        'name'  =>  'Iframe Code'
                    ],  
                    [
                        'type' => 'select',
                        'id'   => 'align_video',
                        'name' => 'Align Video',
                        'options'         => array(
                            'left'       => 'Left',
                            'right' => 'Right',
                        ),
                    ],  
                    [
                        'type'  => 'wysiwyg',
                        'id'    => 'content',
                        'name'  =>  'Content',
                        'options' => array(
                            'tinymce'       => array(
                                'toolbar1'      => 'bold,italic',
                                'toolbar2'      => '',
                                'toolbar3'      => '',
                            ),
                        ),
                    ]
                    
                ],
            ];
            return $meta_boxes;
            
        }

    the Tinymce tool bar doesnt change at all on my end. Other editor settings like: 'media_buttons' => FALSE works just fine.

    #19742
    Long NguyenLong Nguyen
    Moderator

    Thank you, I will check it out and let you know later.

    #21119
    Key_WebdesignKey_Webdesign
    Participant

    I seem to have the same issue here. Is there any update on this?

    #27515
    JackkyJackky
    Participant

    Hi! I have made a temporary solution for this purpose: https://support.metabox.io/topic/strange-wysiwyg-behavior-inside-group/#post-27514

    #27597
    Anh TranAnh Tran
    Keymaster

    Hey guys,

    Thanks Jackky, the settings now works in this commit. I'll release the new version very soon.

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