Support

Account

Home Forums Search Search Results for 'reusable group'

Search Results for 'reusable group'

reply

  • @timh Ah thanks, so maybe it just doesn’t work with the reusable field group being a flexible content.

    I thought the reusable field group works as a “row” so you could add more html etc. to the template.

  • Hi,

    First, when you use a ACF Reusable Field, you have to know that you have one more imbrication in your template, so you have to do a loop with the Reusable Field to get its childs fields.

    Secondly, I don’t see where you call your ACF Reusable Field in your template, you have to call it : modules_main_reusable.

    Third, I encourage you to use this fork of the plugin if you want to have multiples Reusable field of an ACF Group Field in a flexible field.
    https://github.com/mvpdesign/acf-reusable-field-group

    Hope it helps.

  • Hi Darisi,

    I’m not sure what you mean exactly. I just downloaded and installed the plugin. This gives me an extra option in the Field Type dropdown: Reusable Field Group.

    I’m using Advanced Custom Fields Pro 5.2.8 with the latest WordPress version, in case that makes a difference.

    In my php templates, i just use the regular ACF functions like get_field() to retrieve the values from the Reusable Field Group fields.

  • 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.

  • I’ve used this plugin in a couple of projects: https://github.com/tybruffy/ACF-Reusable-Field-Group

    Haven’t found any problems yet

  • There is a fork of the plugin that fix the issue of adding n number of instances in a flexible field :

    https://github.com/mvpdesign/acf-reusable-field-group

    That actually seems to be a fork of a different plugin than the one mentioned above (created by @beneverard). I haven’t tried it before but it looks interesting thank you, I will try it out on my next project (that requires it) and report back.

    This is still a feature I desire greatly from ACF and would love to see it as part of the core functionality (or happy to pay for a premium add-on).

  • Hello,

    There is a fork of the plugin that fix the issue of adding n number of instances in a flexible field :

    https://github.com/mvpdesign/acf-reusable-field-group

    cc : @Will @shanomurphy

  • Hi Daniel,
    If I’m understanding you correctly, someone has implemented a plugin that does what you’re asking for. It’s called ACF Reusable Field Group: https://github.com/mvpdesign/acf-reusable-field-group

    Let’s say you have 2 field groups you want to choose from: FG1 and FG2

    Create a 3rd field group (let’s call it Repeater Group) that’s a repeater with a Reusable Field Group field in it. Add the Repeater Group to your pages.

    Then, when filling out the page, you would add a row to the Repeater Group Field, select FG1 and fill it out. Add a new row, select FG2, and fill it out. Just watch out for ACF Inception, I think it might be possible to select the Repeater Group itself and create a field within a field within a field. πŸ™‚

  • Here’s the code I created.

    https://github.com/theideabureau/acf-reusable-group-field

    This plugin works well and is very handy. However I’ve just run into one caveat – when using the Reusable Group Field within a Flexible Content Field you can only use it once per page.

    If you try and use a Reusable Group in more than one row it doesn’t seem to store a separate database entry for each instance of the group.

    This would be such a great feature to have as it would give ACF a really nice modular approach.

  • Thanks @beneverard!

  • Here’s the code I created.

    https://github.com/theideabureau/acf-reusable-group-field

  • Hey guys,

    That functionality would be awesome to have it on the wp-admin.


    @elliot
    I think that a very intuitive way of appearing on the admin page would be to add a “duplicate field group” or “clone” option on each group. Just like the Duplicate Post plugin works. You can use some inspiration from that plugin as well.

    Adding it as a paid extension wouldn’t be a bad idea, you already give a lot with the free version of ACF it makes our life easier πŸ™‚

    Best,

  • Hi beneverard,

    because of this

    http://support.advancedcustomfields.com/forums/topic/cant-add-more-fields/

    thread: Have you already get it working? πŸ™‚

    Regards,
    Svenni

  • Hi elliot,

    I don’t know what you excactly mean, but the workaround in the other high topic to this problem

    http://support.advancedcustomfields.com/forums/topic/max_input_vars-solution-not-working-for-me/

    with the user.ini fixed it. But I don’t think that this should be a solution for ever …?

    But I think about a way we don’t depend on such big field groups:

    Is there a chance that you can implent conditional (tab and/or hide) logic over field groups? Than we can split big field groups and can use tabs and/or hide fields furthermore.

    Or add a new field typ “field group” so we can include a field group in a field group.

    Edit: Another user had the idea a month ago:

    http://support.advancedcustomfields.com/forums/topic/reusable-field-groups/

    Greetings,
    Svenni

  • Hi @beneverard

    This is an awesome idea, and if you can get it to work, I would love to add it in!

    Cheers
    E

  • Hi Elliot,

    I’ve started to (attempt) to build a custom field for this, here’s the interface I have so far –> http://cl.ly/image/0B1v1y0t4145

    It uses acf_field_group::get_field_groups(array()) to fetch the current field groups, excludes the field group you’re currently editing, and then displays them in the select element.

    I’m not sure how far I’ll get with making a custom field… if anything comes of it I’ll be sure to share the code.

  • Hi guys.

    Thanks for the feedback. Currently you can achieve this via the export to PHP functionality, however, yes this would be great in the interface.

    Can I ask how you envisage this functionality appearing in the wp-admin?

  • +1 – This would be quite useful.

  • Yea, I guess that could work.

    Feature request then: Would it be possible to create a new field type of a custom field group? Selecting this type would give you a select list of all the custom field groups and selecting one would pull it into this group (maybe not in this edit screen, but where the actual content is entered. Just an idea.

  • Hi @circlecube

    The best solution is to export your field groups to PHP.

    That way, you can store this array as a variable and use it in multiple register_field_group functions.

    Cheers
    E

Viewing 21 results - 51 through 71 (of 71 total)