Support

Account

Home Forums ACF PRO Is it possible to create an infinite number of nested fields?

Solved

Is it possible to create an infinite number of nested fields?

  • Is it possible to create an infinite number of nested fields using ACF? (using repeaters/clones/flexible content?)

    What I would like to achieve is to be able to repeat a group of fields inside itself multiple times. The goal is to get a hierarchy, for example : A field “tab” contains a field “title” and two fields “tabs”. The two “sub-tabs” can contains titles/tabs and so on.

    What I tried :

    • A flexible content field containing a clone of itself : stops nesting from the second level of nesting.
    • A repeater containing a clone of itself : same result

    I don’t know if I’ve been clear enough but thanks for your answers 😉

  • I don’t think that a clone field will clone itself. What you are asking would cause ACF to go into an infinite loop trying to create those fields in the admin which is why it will not continue.

    Is it possible to create infinitely nested fields? Yes, it could probably be done, but not by using the clone field unless you want to disable the checking which would cause your site to crash. Is it a good idea? Probably not.

  • Thanks for the explanation 🙂

    “Yes, it could probably be done”

    Can you give me a clue on how I can achieve that?

    Thanks !

  • When I say “Yes, it could probably be done” it’s because anything can be done given enough time.

    In this case, if you want ACF to do it you’ll need to hack the ACF files. Exactly how, I wouldn’t know. And there is a difference between possible and practical.

    I would suggest that instead of cloning the repeater you create a reasonable number of nested repeaters and clone the individual fields into the repeater. You can always and more nested repeaters later.

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

The topic ‘Is it possible to create an infinite number of nested fields?’ is closed to new replies.