Nested Clones Break

Support MB Group Nested Clones Break

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #8231
    adamdaviesadamdavies
    Participant

    Hi,

    I have created a group of inputs that are clonable and within this group there is another clonable input. I can only see the nested cloneable inputs add button but I can see the parent one for the group in the html given the display none style.

    Neither have reached there maximum clones specified. Any ideas?

    array(
                'name'   => 'Create Feature Banners', 
                'id'     => $prefix .'home_banner_features',
                'type'   => 'group',
                'clone'  => true,
                'max_clone' => 2,
                'sort_clone' => true,
                'add_button' => 'Add Bannner',
    
                	'fields' => array (
    		            array(
    		                'name'  => 'Banner Title',
    		                'desc'  => 'Enter title for banner',
    		                'id'    => $prefix . 'feature_banner_title',
    		                'type'  => 'text',
    		                'size'  => 60,
    		            ),
    		            array(
    		                'name'  => 'Banner Description',
    		                'desc'  => 'Enter description text for banner',
    		                'id'    => $prefix . 'feature_banner_desc',
    		                'type'  => 'textarea',
    		            ),
    		            array(
    		                'name'  => 'Banner Background Image',
    		                'desc'  => 'Select an image for the background',
    		                'id'    => $prefix . 'feature_banner_bg',
    		                'type'  => 'file_input',
    		                'max_file_uploads' => 1,
    		            ),
    		            array(
    					    'name'        => 'Banner links/buttons',
    					    'id'          => $prefix .'feature_banner_links',
    					    'type'        => 'post',
    					    'clone'		  => true,
    					    'max_clone'   => 4,
    					    'add_button'  => 'Add Button',
    					    'sort_clone'  => 'true',
    					    // Post type.
    					    'post_type'   => array('page', 'post','event', 'course'),
    					    // Field type.
    					    'field_type'  => 'select_advanced',
    					    // Placeholder, inherited from <code>select_advanced</code> field.
    					    'placeholder' => 'Select an item to link',
    					    // Query arguments. See https://codex.wordpress.org/Class_Reference/WP_Query
    					    'query_args'  => array(
    					        'post_status'    => 'publish',
    					        'posts_per_page' => - 1,
    					    )
    					)
    				)
    			)

    Here is the code in question.

    #8240
    adamdaviesadamdavies
    Participant

    I seem to be able to get the button to appear if I increase the group max_clone value to 5 so I think it is due to a counter that is keeping track. On the face maybe the child clone options are increasing the parent clone as well rather than being independent.

    #8260
    adamdaviesadamdavies
    Participant

    Any ideas?

    #8266
    Anh TranAnh Tran
    Keymaster

    Hi Adam,

    I'm working on it. Please wait.

    #8272
    adamdaviesadamdavies
    Participant

    Thanks Anh! Really appreciate it and thanks for keeping me updated.

    #8286
    Anh TranAnh Tran
    Keymaster

    Hi Adam, I've just fixed it on Github. Can you test it?

    #8291
    adamdaviesadamdavies
    Participant

    Thanks Anh.

    I will download and test right now for you.

    Regards

    #8292
    adamdaviesadamdavies
    Participant

    That's worked great thank you ?

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Nested Clones Break’ is closed to new replies.