Custom Fields
Re-Envisioned
Support MB Blocks Strange wysiwyg behavior inside group

  • Creator
    Topic
  • #17764
    Jackky
    Participant

    I’m trying to implement visual editor field inside clonable group like this:

    <?php
    
    $meta_boxes[] = [
        'title'           => 'Текстовые триггеры',
        'id'              => 'text-trigger',
        //'description'     => 'A custom hero content block',
        'type'            => 'block',
        'icon'            => 'awards',
        'category'        => 'tsm',
        'context'         => 'side',
        'render_template' => get_template_directory() . '/gutenberg/text-trigger.php',
        'fields'          => [
            [
                'id'                => 'triggers',
                'type'              => 'group',
                'name'              => 'Контент',
                'clone'             => true,
                'sort_clone'        => true,
                'add_button'        => '+',
                'collapsible'       => true,
                'group_title'       => 'Элемент {#}',
                'save_state'        => true,
                'fields'            => [
                    [
                        'id'                => 'icon',
                        'type'              => 'single_image',
                        'name'              => 'Иконка',
                    ],
                    [
                        'id'                => 'text',
                        'type'            => 'wysiwyg',
                        'name'                => 'Текст',
                        'options'             => [
                                'media_buttons'   => false,
                                'teeny'           => true,
                                'textarea_rows'       => 10,
                        ],
                    ],
                ]
            ],
        ],
    ];

    And that’s what i get (different bugs on load, sorting and adding new):
    null

Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #17802
    Anh Tran
    Keymaster

    Hi Jackky, let me check it and will get back to you soon.

    #17845
    Jackky
    Participant

    Also I have noticed, that opts like ‘teeny’, my custom hooks on tinymce, like custom formst select, buttons and styles doesn’t take effect inside getenberg block. TinyMCE rendering as is. And this issue not only inside clonable group.

    #17875
    Anh Tran
    Keymaster

    Hi Jackky,

    I found the problems. It’s kind of a complicated thing in Gutenberg, since the editor is generated on demand using JavaScript. So, some PHP options won’t be applied. And in that case, the default settings of the editor is applied. I’m afraid I don’t have a good solution for it at the moment.

    #17876
    Jackky
    Participant

    I’ve checked now how is working classic editor standart block, and it applying all the hooks and styles from my theme

    #20405
    Jackky
    Participant

    Hello! I’m just wondering: still no solutions for applying custom hooks for tinymce?

    #20409
    Long Nguyen
    Moderator

    Hi Jack,

    The developer team is trying to research and fix the issue with the options of the WYSIWYG field in a block. I will let you know if there is any information.

    #20411
    Jackky
    Participant

    It’s not just about options, it’s about custom filters like ‘tiny_mce_before_init’, ‘teeny_mce_buttons’ etc.
    Let me know, please, then get any results. Waiting for fixing it, thank you!

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