Support

Account

Home Forums Feature Requests Reusable Field Groups

Solving

Reusable Field Groups

  • I think it’d be awesome to register a field group, but to be able to use that group within another group elsewhere.

    Example:

    I’ve got various similar field groups for various post types, it’s not appropriate to have one field group to cover them all, however there is a small sub-set of reused fields.

    Rather than having to duplicate this sub-set of fields it’d be awesome if they could be register as a group of their own, but then called in.

    That way they’re registered just once, so updating them in the future is easy.

    I currently achieve this by registering the fields in code… but I dislike this method vs the ACF field builder.

  • +1 – This would be quite useful.

    • Elliot

    • September 5, 2013 at 12:39 pm

    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?

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

    • Elliot

    • September 8, 2013 at 6:39 pm

    Hi @beneverard

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

    Cheers
    E

    • Svenni

    • October 6, 2013 at 5:17 am

    Hi beneverard,

    because of this

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

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

    Regards,
    Svenni

    • mcdg

    • December 6, 2013 at 2:21 am

    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,

  • Here’s the code I created.

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

    • mcdg

    • December 6, 2013 at 2:56 am

    Thanks @beneverard!

    • jrwdev

    • December 10, 2013 at 5:01 am

    +1 for this request as well.

    I also have an idea similar to this for the flexible layouts. Creating flexible layouts with the add-on is awesome. It has become one of the most used features for my sites. However, it would be incredibly awesome to be able to reuse layouts. I’ve created a field group with 30 layouts in a group. It makes it so I can create less templates in wordpress. However, if I want to reuse any of those layouts in another field group, I have to recreate them from scratch. It’d be nice to separate this logic a bit so we can reuse the layouts similar to the reuse of field groups talked about above.

    • Svenni

    • December 10, 2013 at 10:57 am

    Thank you, first test looks great. πŸ™‚

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

    • Will

    • February 18, 2014 at 7:55 pm

    @shanomurphy agreed. I just tried to use it to include a small set of fields more than once within a large field group. Works great but all of the fields wind up with the same values as the first. Presumably this is because all of the fields included, no matter how many times, share the same field key from the original field group (like field_5303024b1c357]).

    I don’t know enough about the innards of ACF to bend the plugin to my will (though I tried!).

  • +1 for this request!

  • Is this the workaround solution?

    http://wptavern.com/buckets-a-wordpress-widgets-alternative-for-placing-content-anywhere

    Buckets + ACF

    bp

  • I’m not familiar with the Buckets plugin but no I don’t think that does what we are after. It seems to fulfil a purpose similar to the ACF Options Page add-on.

    • zenics

    • March 13, 2015 at 2:15 am

    Does this plugin still works. couldt get it to work with latest version of AFC 5.2.0

  • When I wrote this plugin it only just worked on V4, minimal testing… just enough to get it going.

    Haven’t needed it since then (Nov 13) so no V5 support.

    • TimH

    • April 3, 2015 at 7:47 pm

    +1

    I am facing similar situations where i want to reuse the same subset of fields. Duplicating all these fields over and over again is a hassle and lot’s of extra work when i want to change 1 of these fields.

  • Hi @elliot,

    Currently you can achieve this via the export to PHP functionality

    Is there a tutorial out here on this or a brief explanation you can give here? That would be an awesome stopgap to having this in the admin ui.

    Thanks!

  • @elliot,

    I’d love to see this in the core plugin! It just makes sense and would be great for other common structures like addresses.

  • 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

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

    • TimH

    • July 24, 2015 at 11:17 pm

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

    Haven’t found any problems yet

    • darisi

    • July 27, 2015 at 6:54 pm

    @timh Any tips on how you used that plugin in the php template? The docs for it are almost nonexistent. Have a bit of trouble (setting it up).

    Thanks

Viewing 25 posts - 1 through 25 (of 44 total)

The topic ‘Reusable Field Groups’ is closed to new replies.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.