Support

Account

Home Forums ACF PRO Is it possible to have 2 flexible field groups, but they work like one Reply To: Is it possible to have 2 flexible field groups, but they work like one

  • I tried couple of things, found this plugin https://github.com/mvpdesign/acf-reusable-field-group which in a way would be possible to make it but it doesn’t seem to work (attached the fields structure).

    and here is the code i’m running through the template:

    
    <?php
    
    // check if the repeater field has rows of data
    if( have_rows('modules_all') ):
    
        // loop through the rows of data
        while ( have_rows('modules_all') ) : the_row(); ?>
    
        <?php
        $checkboxcustom = get_sub_field('is_custom_modules');
        if($checkboxcustom) { // is yes ?>
        CUSTOM
                        <?php
                        if( have_rows('modules_custom') ):
    
                            while ( have_rows('modules_custom') ) : the_row(); ?>
    
                              <?php  if( get_row_layout() == 'module_sample' ): ?>
    
                                <?php get_template_part('templates/modules-custom/module', 'sample') ?>
    
                              <?php endif; ?>
    
                          <?php endwhile; ?>
    
                         <?php endif; ?>
    
        <?php } else { ?>
        MAIN
                        <?php
                        if( have_rows('modules_main') ):
    
                            while ( have_rows('modules_main') ) : the_row(); ?>
    
                              <?php  if( get_row_layout() == 'module_main' ): ?>
    
                                <?php get_template_part('templates/modules-main/module', 'main') ?>
    
                              <?php endif; ?>
    
                          <?php endwhile; ?>
    
                         <?php endif; ?>
    
        <?php } ?>
    
       <?php endwhile;
    
    else :
    
    endif;
    
    ?>
    

    IT seems to be working nicely for the Main fields but not the Custom one, as they are not beeing displayed.