Include or exclude nested groups, is it possible?
Support › MB Include Exclude › Include or exclude nested groups, is it possible?
- This topic has 4 replies, 2 voices, and was last updated 4 years, 5 months ago by
Vladimir Mujakovic.
-
AuthorPosts
-
November 3, 2020 at 3:22 AM #22677
Vladimir Mujakovic
ParticipantI 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(...) ), ) ), ) )
November 3, 2020 at 3:41 AM #22678Vladimir Mujakovic
ParticipantI 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.
November 3, 2020 at 9:41 AM #22682Long Nguyen
ModeratorHi,
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.
November 3, 2020 at 1:17 PM #22688Vladimir Mujakovic
ParticipantI 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).
November 15, 2020 at 3:59 AM #22852Vladimir Mujakovic
ParticipantIs there any news on this? or an alternative approach I can take? To reduce the massive lag in admin.
-
AuthorPosts
- You must be logged in to reply to this topic.