I’m finding duplicating certain fields within / between field groups frustrating.
It would be really useful to be able to save frequently used fields to a ‘common library’ of flexible fields. Please see the hierarchy example below to see the duplication that is currently occurring within a single field group.
And how using a ‘common library’ approach would save duplication…
Common Library 1
Taking this idea a step further, being able to nest an entire field group inside another would be useful. Allowing (as per this example) the common fields AND the column setup to be duplicated.
One flexible content layout to rule them all!
I’ve had some success with using this: https://github.com/tybruffy/ACF-Reusable-Field-Group
+100 from me too.
The above example may look very “constructed”, here is another one:
I have a custom “Image” field group with a few settings. I want to be able to insert this on a page in different field groups. The only possibility is to create the necessary fields multiple times.
In this case it may also be possible to register a new field type (with hooks, don´t know if that is supported because I had no use yet), but there are other examples there this is very useful.
This weekend I started looking at the available plugins for reusable field groups. Testing and research turned into an entire weekend and at the end I had created my own version of a reusable field group field.
It works a bit differently than the others, it works by rebuilding field groups that include a reusable field group field ans local field groups which override the original field groups. This only works in ACF5, ACF4 does not support
I have not completely tested it and would be interested in feedback or bug reports. I’ll also answer question. There’s not documentation yet, mostly because I think that the instructions when creating the field are pretty self explanatory.
Not sure if you are still needing this, but I had exactly the same situation as yours. I had button that have crazy conditions with multiple fields and needed to be used on many different field groups.
So I’ve created acf-component-field plugin, that does exactly what you described. Component Field Group are reusable and nest-able, with no extra php functions or classes you’d need to initiate in your theme.
Demo can be found here: http://gummi.io/acf-component-field/
Please feel free to play around in the backend and see how it’s setup.
I hope this helps you and anyone else who’s looking for this type of functionality. 🙂
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.