Forum Replies Created
-
AuthorPosts
-
March 26, 2026 at 5:15 PM in reply to: MB Conditional Logic not working in MB Blocks (Normal Context) #49850
[email protected]
ParticipantHi,
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; });April 26, 2024 at 1:58 PM in reply to: Wysiwyg editor in Blocks not have Tab to change mode html or Visual #45319[email protected]
ParticipantWe just tried with context='side', with all plugins deactivated, and even switching WordPress themes, but it still fails.
Regards
April 26, 2024 at 1:43 PM in reply to: Wysiwyg editor in Blocks not have Tab to change mode html or Visual #45318[email protected]
ParticipantHello,
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/XZT955fRegards.
April 25, 2024 at 4:15 PM in reply to: Wysiwyg editor in Blocks not have Tab to change mode html or Visual #45310[email protected]
ParticipantWe 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
April 25, 2024 at 2:55 PM in reply to: Wysiwyg editor in Blocks not have Tab to change mode html or Visual #45309[email protected]
ParticipantI 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" },[email protected]
ParticipantWhat is happening?
Thanks in advance
[email protected]
ParticipantHi 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.
[email protected]
ParticipantSorry for the previous errors in the post. This is the console error:
Block validation: Block validation failed for
core/button(
Content generated bysavefunction:Block validation: Block validation failed for
core/media-text
Content generated bysavefunction: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 ], ] ] -
AuthorPosts