Support Forum » User Profile

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • contabilidad@sngular.com[email protected]
    Participant

    Hi,

    I’m providing the block details for reference. As you can see, there are fields conditioned to the 'Formulario' checkbox. When checked, these fields should be visible, but they remain hidden.

    Interestingly, if I change the attribute to 'context' => 'aside', the conditional logic works perfectly. The issue only occurs when using 'context' => 'normal'.

    Best regards.

    
    add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
        $meta_boxes[] = [
            'title'                     =>    __('Hero Landing', THEME_DOMAIN),
            'id'                        =>    'hero-landing',
            'description'               =>    __('Hero Landing', THEME_DOMAIN),
            'type'                      =>    'block',
            'icon'                      =>    'awards',
            'category'                  =>    'blocks',
            'enqueue_assets' => function () {
                wp_enqueue_style('theme-header', get_template_directory_uri() . '/assets/css/main.css');
                wp_enqueue_style('theme-icons-header', get_template_directory_uri() . '/assets/css/icons.css');
            },
            'render_template'           =>    THEME_DIR_PATH . '/gutenberg-blocks/hero-landing/template.php',
            'preview'                   => [
                'esPreview' => '1',
                'capture' => get_template_directory_uri() . '/assets/img/hero-landing.png',
            ],
            'supports'                  => [
                'customClassName'   =>    true
            ],
            'context'         => 'normal',
            'fields'                    => [
                [
                    'type' => 'text',
                    'id'   => 'id',
                    'name' => __('Identificador', THEME_DOMAIN),
                ],
                [
                    'type' => 'text',
                    'id'   => 'class_style',
                    'name' => __('Clase CSS', THEME_DOMAIN),
                ],
                [
                    'type' => 'single_image',
                    'id'   => 'image',
                    'name' => __('Imagen Fondo', THEME_DOMAIN),
                ],
                [
                    'name'          => __('Color Fondo Tarjeta', THEME_DOMAIN),
                    'id'            => 'background_card',
                    'type'          => 'color',
                    'alpha_channel' => true,
                    'js_options'    => [
                        'palettes' => [
                            '#4066ff', 
                            '#1c46eb', 
                            '#0027c2', 
                            '#0021a6', 
                            '#001a80', 
                            '#f2faff', 
                            '#e0f2ff', 
                            '#bde0f8', 
                            '#8fbcdb', 
                            '#6b9dbf',
                        ],
                    ],
                ],
                [
                    'type' => 'wysiwyg',
                    'id'   => 'text',
                    'name' => __('Contenido Tarjeta', THEME_DOMAIN),
                    'raw'  => true,
                    'options' => [
                        'textarea_rows' => 4,
                        'teeny'         => true,
                    ]
                ],
                [
                    'name' => __('¿Formulario?', THEME_DOMAIN),
                    'id'   => 'is_form',
                    'type' => 'checkbox',
                    'std'  => 0
                ],
                [
                    'name'          => __('Color Fondo Tarjeta', THEME_DOMAIN),
                    'id'            => 'background_form',
                    'type'          => 'color',
                    'alpha_channel' => true,
                    'js_options'    => [
                        'palettes' => [
                            '#4066ff', 
                            '#1c46eb', 
                            '#0027c2', 
                            '#0021a6', 
                            '#001a80', 
                            '#f2faff', 
                            '#e0f2ff', 
                            '#bde0f8', 
                            '#8fbcdb', 
                            '#6b9dbf',
                        ],
                    ],
                    'hidden' => ['is_form', '!=', 1]
                ],
                [
                    'name' => __('Titulo Formulario', THEME_DOMAIN),
                    'id'   => 'form_title',
                    'type' => 'wysiwyg',
                    'raw'  => true,
                    'options' => [
                        'textarea_rows' => 4,
                        'teeny'         => true,
                    ],
                    'hidden' => ['is_form', '!=', 1]
                ],
                [
                    'type' => 'text',
                    'id'   => 'short_code',
                    'name' => __('Codigo Formulário', THEME_DOMAIN),
                    'hidden' => ['is_form', '!=', 1]
                ],
            ]
        ];
    
        return $meta_boxes;
    });
    

    https://imgur.com/a/YVAQ112
    https://imgur.com/SyL35RU

    contabilidad@sngular.com[email protected]
    Participant

    We just tried with context='side', with all plugins deactivated, and even switching WordPress themes, but it still fails.

    https://ibb.co/80TxFHz

    Regards

    contabilidad@sngular.com[email protected]
    Participant

    Hello,

    Our block doesn't have the context != 'side', it's context='normal'. When we click on the pencil edit icon, it doesn't change to the eye, and the WYSIWYG only appears in text mode. We've tried deactivating all the plugins and it still happens. This is occurring in several projects after updating to the new version. Any ideas on what might be causing this?

    Definition Block: https://ibb.co/Nj1Sjqd

    MB-Block 1.5.0 - Fail: https://ibb.co/JsjM5Pz
    MB-Block 1.4.2 - Correct: https://ibb.co/XZT955f

    Regards.

    contabilidad@sngular.com[email protected]
    Participant

    We can revert to previous versions using composer? composer require meta-box/mb-blocks:1.4.2 it fails, saying that it's only possible to download the master. With mb-blocks version all is corrected.

    Thx and regards

    contabilidad@sngular.com[email protected]
    Participant

    https://ibb.co/6wtpP7B

    https://ibb.co/djH2SVt

    in reply to: Error with mb-revision extension #44512
    contabilidad@sngular.com[email protected]
    Participant

    I tried with the old composer.json and with this new one updating all versions and got the same problem.

    "require": {
            "aws/aws-sdk-php": "3.238.6",
            "wpackagist-plugin/meta-box": "dev-trunk",
            "wpackagist-plugin/mb-rest-api": "dev-trunk",
            "meta-box/mb-revision": "dev-master",
            "meta-box/mb-settings-page": "dev-master",
            "meta-box/meta-box-conditional-logic": "dev-master",
            "meta-box/meta-box-group": "dev-master"
        },
    in reply to: Error with mb-revision extension #44511
    contabilidad@sngular.com[email protected]
    Participant

    What is happening?

    Thanks in advance

    in reply to: Required field is stored empty #40467
    contabilidad@sngular.com[email protected]
    Participant

    Hi again,

    In local I don't reproduce the core/button, core/media-text.

    The require field still doesn't work correctly and it doesn't work on custom fields of custom taxonomies either.

    in reply to: Required field is stored empty #40446
    contabilidad@sngular.com[email protected]
    Participant

    Sorry for the previous errors in the post. This is the console error:

    Block validation: Block validation failed for core/button (
    Content generated by save function:

    Block validation: Block validation failed for core/media-text
    Content generated by save function:

    And this is the code

    $meta_boxes[] = [
            'title'                     =>    __('Hero', DOMAIN),
            'id'                        =>    'sng-hero',
            'description'               =>    __('Hero', DOMAIN),
            'type'                      =>    'block',
            'icon'                      =>    'awards',
            'category'                  =>    'sng-blocks',
            'render_template'           =>    PATH . '/gutenberg-blocks/hero/template.php',
            'preview'                   => [
                'esPreview' => '1',
                'capture' => get_template_directory_uri() . '/assets/img/previews/hero.png',
            ],
            'enqueue_assets' => function () {
            },
            'supports'                  => [
                'customClassName'   =>    true
            ],
            'fields'                    => [
                [
                    'type' => 'single_image',
                    'id' => 'image',
                    'name' => __('Imagen', DOMAIN)
                ],
                [
                    'type' => 'text',
                    'id' => 'title',
                    'name' => __('Título',DOMAIN),
                    'required' => true
                ],
            ]
    ]
Viewing 9 posts - 1 through 9 (of 9 total)