Checkbox Tree not displayed in Sub-group fields

Support MB Group Checkbox Tree not displayed in Sub-group fieldsResolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #33987
    indatext.comindatext.com
    Participant

    If a hierarchical taxonomy is set to display in a sub-group Taxonomy Advanced field with a checkbox tree option, than is does not display sub-terms. If set to Select Advanced, it finds sub-terms, but does not save those.

    For a normal field, not a part of sub-group it displays OK.

    #34000
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The subfield taxonomy_advanced in a group, field type checkbox_tree works as well on my site. Screenshot https://imgur.com/iNBMl1Z
    Code:

            'fields' => [
                [
                    'name'   => __( 'Group', 'your-text-domain' ),
                    'id'     => $prefix . 'group_6rzszh8tdbl',
                    'type'   => 'group',
                    'fields' => [
                        [
                            'name'       => __( 'Taxonomy Advanced', 'your-text-domain' ),
                            'id'         => $prefix . 'taxonomy_advanced_hm330v010b',
                            'type'       => 'taxonomy_advanced',
                            'taxonomy'   => ['category'],
                            'field_type' => 'checkbox_tree',
                        ],
                    ],
                ],
            ],
    #34015
    indatext.comindatext.com
    Participant

    But it does not display that on my side


    [
                            'name'              => __( 'Type of Glass', 'your-text-domain' ),
                            'id'                => $prefix . 'door_glass_type_selector',
                            'type'              => 'taxonomy_advanced',
                            'label_description' => __( 'only select one type for this variant', 'your-text-domain' ),
                            'taxonomy'          => ['type-of-glass'],
                            'field_type'        => 'checkbox_tree',
                            'remove_default'    => true,
                        ],
    #34016
    indatext.comindatext.com
    Participant

    I also have additional meta-definition for setting pics for terms in custom plugin as:

    // Add custom meta for Types of Glass Taxonomy
    add_filter( 'rwmb_meta_boxes', 'prefix_register_taxonomy_meta_boxes' );
    function prefix_register_taxonomy_meta_boxes( $meta_boxes ){
        $meta_boxes[] = array(
            'title'      => 'Additional Meta for Doors',
            'taxonomies' => array('type-of-glass','jamb'), // THIS: List of taxonomies. Array or string
    
            'fields' => array(
                array(
                    'name' => 'Featured?',
                    'id'   => 'featured_glass',
                    'type' => 'checkbox',
                ),
                array(
                    'name' => 'Preview Image',
                    'id'   => 'glass_single_image',
                    'type' => 'single_image',
                ),
            ),
        );
        return $meta_boxes;
    }

    Maybe that is causing the issue. What to use instead of taxonomies for array of taxonomies here, if one of taxonomies is advanced taxonomy?

    #34020
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please tick the parent term to show child terms like my screenshot https://imgur.com/iNBMl1Z
    The term meta does not relate to this case.

    #34040
    indatext.comindatext.com
    Participant

    Aha! Thank you. Is there a way to display hierarchical taxonomy not collapsed by default, or at least somehow visually indicate terms with children?

    #34051
    Long NguyenLong Nguyen
    Moderator

    Hi,

    There is no option to display the child term by default or mark the parent term with a specific character. I will inform the development team to consider supporting this case in future updates.

    #34053
    indatext.comindatext.com
    Participant

    I shall try to implement it, since Metabox allows a lot of customisation on the back end and I figured out how to load amending styles. But yes, from a layperson perspective the expected default behaviour is to have checkbox tree blooming, not collapsed. Since it is a default behaviour in side panel WP Metabox.

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