So I looked around quite a bit looking for an answer for this and debugging but couldn’t really find an answer. If its right in front of my face I do apologize, but my progress has definitely been halted on this. I thought I read in a few instances that this couldn’t be done, but I wasn’t sure of the date or not so am unsure if thats changed.
The situation I have is that I’m using a Flexible Content to generate multiple layout types for the site I’m working on. Thats been working great, but I later realized then when I work on it again it would have been wiser to put them under a repeater field or Flexible Content Field that generated the skeleton structure for that section.
+ New Section
Adjust the field settings for it that determine container sizing, visibility, padding etc etc etc.
Then from within You click New Content which would bring up a list of all the types of layouts that can be put in.
Where I kind of hit a brick wall here is when I tried to do the nesting. Because I had already built all these layouts and the client all of a sudden wanted that, rather then rewrite everything to work like that I cloned the Flexible content into a new type of content that was in the original.
But now I cannot for the life of me figure out how to pull the relevant data from that field. At the moment my code is kind of a mess due to debugging trying to figure it out but I will post it if need be, though to be honest, since I don’t quite know how even if its possible, I’m not sure how much help it would be. I will however do whatever I can to get the problem resolved.
Thanks in advance.
Are you trying to pull existing data into the new fields? if this is the case then no, it is not possible. Any existing posts created with the old fields would need to be recreated using the new fields. The data for repeaters and flex fields is stored significantly different.
If you are talking about just showing the data that is entered on the front end, the best I can do at this point is point you to the documentation for clone fields, repeaters and flex fields. I’d need more to go on to do more.
I personally do not use clone fields. I’ve tried them on a couple of sites and have always run into issues with them. I can try to help you, but I’ll need more information on exactly where you’re running into the problem.
I winded up getting rid of clones ALTOGETHER. They caused a lot more issues then I would have expected. I instead wound up creating more nested flexibles by making copies and moving them to the other areas and renaming them.
This actually then created a whole issue of itself as too many requests were being made to the DB so trying to load the dashboard for changes is extremely slow.
It didn’t wind up effecting the front end though so we are going to roll with it for now and then redo the setup so that less queries are made.
I made the mistake of making my modules their own grid containers rather then making a section that determine the grid first and then drops code into it. Swapping that around will cut down the code by about 66 percent or more.
So it wound up being
Bring up a list of Layouts
Choose Layout X
Layout X loops through and allows for you to grab the initial list to embed in there but runs a script to check which one is being currently called so it can’t call itself and create an infinite loop.
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.