Title: Repeatable Groups
Last modified: August 24, 2016

---

# Repeatable Groups

 *  Resolved [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/)
 * Hello
 * I know i can insert repeatable fields inside a repeatable group, but i was wondering
   if there is way to insert a repeatable group inside another repeatable group.
 * thank you
 * [https://wordpress.org/plugins/cmb2/](https://wordpress.org/plugins/cmb2/)

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/repeatable-groups/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/repeatable-groups/page/2/?output_format=md)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6032899)
 * I do not believe CMB2 has that level of repeatability available.
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6032915)
 * Yes i thought so. Another issue with my repeatable fields is that the remove 
   icon (x) and the toggle icon dont work on the front end. om the backend everything
   is ok
 * thank you
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6032935)
 * Could you check your browser’s developer console log to see if any javascript
   errors are appearing when you click the icons?
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033015)
 * hello there i cant see any errors
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033016)
 * have a look here
    [http://www.sight79.net/demosite/sample-page/](http://www.sight79.net/demosite/sample-page/)
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033017)
 * It looks like nothing at all is being rendered, which is going to be errors/issues
   before the javascript comes into play.
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033021)
 * i think i did something wrong with my files. what i am doing is that i created
   a custom plugin. this has the following structure.
    myplugin(folder) – myplugin.
   php
 * should i copy the entire cmb2 forlder in my mplugin folder and then put
 * if ( file_exists( dirname( __FILE__ ) . ‘/cmb2/init.php’ ) ) {
    require_once 
   dirname( __FILE__ ) . ‘/cmb2/init.php’; } elseif ( file_exists( dirname( __FILE__).‘/
   CMB2/init.php’ ) ) { require_once dirname( __FILE__ ) . ‘/CMB2/init.php’; } in
   my php file?
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033023)
 * If you are bundling the CMB2 files as a library in the plugin, then yes you’d
   want to go that route, but you also need to make sure that those require_once
   and file_exists paths match up with the hierarchy you’re creating. Those may 
   need to be tweaked a little bit. You can also get rid of part of that if check
   since you’ll know the capitalization of the folder. Just go with whichever one
   you’re using for the name.
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033032)
 * hello again
 * i am trying to work with repeating groups on the frontend but can make it.
 * i am using your simple examples. first of all i installed cmb2 plugin from wordpress.
   then i added these lines in my themes functions. The group works fine on the 
   back end. On the frontend everything works ok except the toggle icon. Any suggestions?
 * you can have a look here ([http://www.sight79.net/demosite/sample-page/](http://www.sight79.net/demosite/sample-page/))
 * /**
    * Get the bootstrap! */ if ( file_exists( __DIR__ . ‘/cmb2/init.php’ ) ){
   require_once __DIR__ . ‘/cmb2/init.php’; } elseif ( file_exists( __DIR__ . ‘/
   CMB2/init.php’ ) ) { require_once __DIR__ . ‘/CMB2/init.php’; }
 * //CREATE METABOX
    add_action( ‘cmb2_init’, ‘cmb2_sample_metaboxes’ ); function
   cmb2_sample_metaboxes() { // Start with an underscore to hide fields from custom
   fields list $prefix = ‘_yourprefix_’; $cmb_group = new_cmb2_box( array( ‘id’ 
   => $prefix . ‘metabox’, ‘title’ => __( ‘Repeating Field Group’, ‘cmb2’ ), ‘object_types’
   => array( ‘page’, ), ) );
 *  // $group_field_id is the field id string, so in this case: $prefix . ‘demo’
   
   $group_field_id = $cmb_group->add_field( array( ‘id’ => $prefix . ‘demo’, ‘type’
   => ‘group’, ‘description’ => __( ‘Generates reusable form entries’, ‘cmb2’ ),‘
   options’ => array( ‘group_title’ => __( ‘Entry {#}’, ‘cmb2’ ), // {#} gets replaced
   by row number ‘add_button’ => __( ‘Add Another Entry’, ‘cmb2’ ), ‘remove_button’
   => __( ‘Remove Entry’, ‘cmb2’ ), ‘sortable’ => true, // beta ), ) ); // Regular
   text field $cmb_group->add_group_field( $group_field_id, array( ‘name’ => __(‘
   Test Text’, ‘cmb2’ ), ‘desc’ => __( ‘field description (optional)’, ‘cmb2’ ),‘
   id’ => $prefix . ‘text’, ‘type’ => ‘text’, ‘show_on_cb’ => ‘cmb2_hide_if_no_cats’,//
   function should return a bool value // ‘sanitization_cb’ => ‘my_custom_sanitization’,//
   custom sanitization callback parameter // ‘escape_cb’ => ‘my_custom_escaping’,//
   custom escaping callback parameter // ‘on_front’ => false, // Optionally designate
   a field to wp-admin only // ‘repeatable’ => true, ) ); }
 * //FRONTEND METABOX
    add_shortcode( ‘cmb-form’, ‘cmb2_do_frontend_form_shortcode’);
   function cmb2_do_frontend_form_shortcode( $atts = array() ) { global $post; if(!
   current_user_can( ‘edit_posts’ ) ) { return _e( ‘You do not have permissions 
   to edit this post.’, ‘lang_domain’ ); } if ( ! isset( $atts[‘post_id’] ) ) { 
   $atts[‘post_id’] = $post->ID; } if ( empty( $atts[‘id’] ) ) { return “Please 
   add a ‘id’ attribute to specify the CMB2 form to display.”; }
 *  $metabox_id = esc_attr( $atts[‘id’] );
    $object_id = absint( $atts[‘post_id’]);
   $form = cmb2_get_metabox_form( $metabox_id, $object_id ); return $form; }
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033033)
 * Are you familiar with your browser developer tools at all? I believe the toggle
   stuff is javascript based, and if you’re getting js errors when you try to use
   it, they should appear in the developer tools console.
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033034)
 * hello firebug doesnt give me any erros
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033041)
 * Do you have a publicly accessible link to the page hosting the metaboxes in question?
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033042)
 * [http://www.sight79.net/demosite/sample-page/](http://www.sight79.net/demosite/sample-page/)
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033043)
 * Looks like the CSS for the hiding isn’t matching up what you have on the frontend.
   Specifically the following:
 *     ```
       #side-sortables .closed .inside,
       .inner-sidebar .closed .inside {
           display:none
       }
       ```
   
 * the .closed .inside part is accurate for you, but the front part of those selectors
   are likely WP admin specific, and not finding anything for the frontend.
 * Until we implement a solution for this, you should be able to prefix a css selector
   yourself with whatever you see fit in your markup. For example
 * `#_yourprefix_demo_repeat .closed .inside {}`
 * and it should take care of it for you.
 *  Thread Starter [andp](https://wordpress.org/support/users/andp/)
 * (@andp)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/repeatable-groups/#post-6033044)
 * seems ok after changing the css. thank you michael

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/repeatable-groups/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/repeatable-groups/page/2/?output_format=md)

The topic ‘Repeatable Groups’ is closed to new replies.

 * ![](https://ps.w.org/cmb2/assets/icon.svg?rev=2866672)
 * [CMB2](https://wordpress.org/plugins/cmb2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmb2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmb2/)
 * [Active Topics](https://wordpress.org/support/plugin/cmb2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmb2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmb2/reviews/)

 * 17 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/repeatable-groups/page/2/#post-6033067)
 * Status: resolved