==== Updated Question with Minimal Reproduction ====
ACF Export – Screenshots
I have a Flexible Content field that has layouts that clone the flexible content field. However I cant add a layout to any layout that is the same type without it breaking.
Please see images.
===== Original Question Follows =====
ACF export: http://pastebin.com/raw/LG5jCSDG
Screenshots: http://imgur.com/a/mRBEw
So I’m trying to make a page builder using clone fields. I’m using the bootstrap framework so I have a flexible content field ‘Elements’ with types: container, row and column, along with my custom content elements (in this example, just a WYSIWYG element).
The container, row and column elements have a clone field of the top level ‘Elements’ flexible content field to allow a recursive builder (putting elements inside of other elements without having to redefine all the elements).
It works fine with:
or
but as soon as I add something in to itself so to speak…
or the more simple (ignoring that this would be invalid bootstrap)
It breaks, and doesn’t show (some of) the cloned fields.
Am I just asking too much, or doing something wrong?
“The have_rows() function will return false when loading a cloned sub field using the ‘Display = Block’ setting. Please note that using the ‘Seamless’ display setting will allow sub have_rows() loops to work as expected.”
https://www.advancedcustomfields.com/resources/clone/
I hope an update will “fix” this.
Hello Mr Fischer, I don’t think you’ve understood my problem correctly.
I haven’t even got to the point of saving the page, never mind trying to load fields.
@first4websites Did you manage to find any solution for this? I’m having the same issue.
@tpeleg No, sorry, didn’t manage to find a solution. Below is the response I got to the support ticket I submitted… I replied (on 28th Oct) clarifying that I hadn’t even gotten to the point of saving to the database and haven’t had a response…
James Stout replied
Hi There,Thanks a lot for the mail,
ACF uses the field’s name (see field settings) to save a value into the database. When saving sub fields, the ‘save name’ is generated by the ancestors names + the row index and can become quite long. It is possible that the length of this ‘save name’ can become too long for the wp_options table, and WP will not be able to save the value at all.
Kindly try creating a duplicate filed for use inside the layout and let me know if the problem persists.
Hope to hear from you soon.
I’m a little confused with your explanation. Are you trying to include the field group in itself by cloning it? This would create an infinite loop. It appears that as soon as ACF tries to include the cloned clone it stops. You cannot re-clone the same fields endlessly and it appears that ACF stops when you get to the second recursion, which makes sense to me.
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!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw
— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.
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.