Add Group

Support MB Builder Add Group

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #4774
    hkipihkipi
    Participant

    Hi,
    Just add Group type field, but it provide field name and id fields.
    How can I define the subfield or clone group of fields?
    Thanks
    gab

    #4777
    Anh TranAnh Tran
    Keymaster

    Just think "group" is a special field. The only difference is it has fields parameters, which is an array of fields. This is a sample code:

    $meta_box = array(
        ’title’ => ’Test’,
        'fields' => array(
            // Group
            array(
                'id' => 'group_id',
                ’type’= > 'group',
                
                // Subfields
                'fields' => array(
                    array(
                        'id' => ’text',
                        ’type’ => ’text’,
                        ’name’ => ’Text’,
                    ),
                    // Other subfields go here
                ),
            ),
        ),
    );
    #4778
    Anh TranAnh Tran
    Keymaster

    Oh, sorry. I didn’t notice this is for MB Builder.

    To add subfields to a group in the Builder, just drag fields to be a child item of the group item (think like you drag and drop the sub menu in the Appearance > Menus).

    #9087
    webdevwebdev
    Participant

    I've been trying to do this as you mention above, but it doesn't seem to work.
    In the Group Builder field, all that appears is the General tab, and dragging fields over it, under it, to the right, etc, as you might do with a standard WP menu... none of it works.
    Seems like it's broken?

    #9088
    webdevwebdev
    Participant

    Further to the above, no group-related code is output in the Code Generator...

    #9098
    Anh TranAnh Tran
    Keymaster

    Hi,

    I've made a video to demonstrate how to create child fields for groups with the Builder extension:

    https://imgur.com/a/PTQVK

    Please take a look. After doing that, the code will be available in the Code export tab.

    Update: I've just updated the plugin, making a drop-zone for sub-fields of groups, so you can drag and drop sub-fields easier.

    #9099
    webdevwebdev
    Participant

    Hi,
    You're right... It does work, but it's very temperamental. I had to try for about 30 seconds before I found the sweet spot and it actually accepted the child element.

    It's much less obvious that it's been connected up properly than the standard WP menus, but it does work.

    Perhaps it could be improved when you have time, but definitely not a priority 🙂

    Thanks.

    #9100
    Anh TranAnh Tran
    Keymaster

    I've just updated the plugin, making a drop-zone for sub-fields of groups, so you can drag and drop sub-fields easier (and make things obvious).

    Please update the plugin.

    #9101
    webdevwebdev
    Participant

    Wow, that was fast 🙂

    I don't see any new versions yet, but maybe it'll take a while to show? Should I be looking for a new Metabox, Metabox AIO, or Metabox Groups?

    #9106
    Anh TranAnh Tran
    Keymaster

    It's the MB Builder extension. I've just updated the Meta Box AIO as well 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Add Group’ is closed to new replies.