Support

Account

Home Forums Feature Requests Reusing Flexible Content Fields

Solving

Reusing Flexible Content Fields

  • Hi,

    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.

    Columns

    • Full Width
      • Col 1
        • Text
        • Image
        • Quote
    • Half and Half
      • Col 1
        • Text
        • Image
        • Quote
      • Col 2
        • Text
        • Image
        • Quote
    • Thirds
      • Col 1
        • Text
        • Image
        • Quote
      • Col 2
        • Text
        • Image
        • Quote
      • Col 3
        • Text
        • Image
        • Quote

    And how using a ‘common library’ approach would save duplication…

    Common Library 1

    • Text
    • Image
    • Quote

    Columns

    • Full Width
      • Col 1
        • <common_library_1>
    • Half and Half
      • Col 1
        • <common_library_1>
    • Thirds
      • Col 1
        • <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!

    Thanks,
    Andy.

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

  • Yes. +1

    This would be SUPER helpful. A lot of times I use Flexible Content for something like “Content Blocks” and have fields that get applied to each layout, like: Background Color, Padding (yes/no), active (yes/no), etc.

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

    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.

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

  • Excellent. I’ll give it a test!

  • Elliot, any updates on this? 🙂

  • I haven’t had luck with any of the reusable field plugins, but it is fairly simple to sort out if you’re willing to handle it in PHP. I’d be willing to setup a demo repo with some examples unless there’s something else floating around out there already.

  • Hello,

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

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Reusing Flexible Content Fields’ is closed to new replies.