Include or exclude nested groups, is it possible?

Support MB Include Exclude Include or exclude nested groups, is it possible?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22677
    Vladimir MujakovicVladimir Mujakovic
    Participant

    I want to exclude/include nested groups, can this be done?

    given this metabox structure:

    $meta_boxes[] = array(
            'title'      => 'Page Section Selector',
            'post_types' => array('page'),
            'fields' => array(
                array(
                    'id'            => 'section_control',
                    'type'          => 'group',
                     ...
                    'add_button' => '+ Add Section',
                    'fields' => array(
                       array(...),
                       array(
                           'id'            => 'cta_section',
                           'type'          => 'group',
                           'include' => array('front-page.php')
                           ...
                           'fields' => array(...)
                       ),
                       array(...),
                       array(...),
                       array(
                           'id'            => 'map_section',
                           'type'          => 'group',
                           'include' => array('page.php')
                           ...
                           'fields' => array(...)
                       ),
                    )
                ),
             )
          )
    #22678
    Vladimir MujakovicVladimir Mujakovic
    Participant

    I would also like to include/exclude based on a dropdown selection, I know that this can be done via show/hide with JS but I am wondering if there is a way to exclude metabox files based on a dropdown selection, not just on the frontend but serverside. Even if the page has to be reloaded.

    #22682
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The extension MB Include Exclude applies for meta boxes only. To show/hide fields and meta boxes, please use the extension MB Conditional Logic.

    To include/exclude meta boxes base on a select, it's very complicated and need AJAX to do without reloading page. I'm going to create a feature request for the developer team to support this case. Thank you.

    #22688
    Vladimir MujakovicVladimir Mujakovic
    Participant

    I would really appreciate support on this issue, thank you for looking into it. I am happy to provide my specific use case. It is kind of hard to explain the problem. But basically i need something that works like the "visible" property in conditional logic that also performs an ajax request to remove the unneeded field groups.

    I have noticed that using the metabox plugin in this way creates a serious performance issue in admin and makes the gutenberg editor unusable, even though you guys have a small example of my implementation in one of your demos. In that demo you can select different sections from a dropdown and clone them. Issue is that my dropdown shows/hides sibling field groups based on selection, so say if i have 13 of those groups (12 hidden 1 visible because it is selected in dorpdown), performing a clone, clones all 13 field groups (200+ inputs), so when i have 7 clones out on the page, we are talking about 7 * 13, which causes a lot of lag. I think this is a limitation that needs to be addressed, I love your plugin library but this has been a concern of mine for some time now.

    On a project where a client is requesting a lot of versatility and utility it would really be helpful to have control over inclusion and exclusion of particular fields (especially when that field is a field group with 20+ custom inputs).

    #22852
    Vladimir MujakovicVladimir Mujakovic
    Participant

    Is there any news on this? or an alternative approach I can take? To reduce the massive lag in admin.

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