Hello,
Thanks for the feedback! You can already add a new layout between an already existing layout by using the “+” icon on the handle.
Regarding your question, the logic is complex since the whole ACF javascript is based on backbone JS and you’ll have to deal with different scenario (initial render, layout appended, layout removed etc…).
Unfortunately I don’t have the time to write tutorials on how backbone JS works in ACF, but you can start by taking a look at the Flexible Content JS source code in the acf-input-pro.js file, and try to interact with it in your own JS code. You can also look for backboneJS introduction articles on the web, it will help you to understand the code structure.
You’ll also find some documentation on how JS hooks are working on the ACF Javascript API page, but it’s definitely not complete.
Hope it helps!
Regards.
Thanks mate! 🙂
I will have a look at those functions.
Okay, i need some more input on this topic 😛
I looked in the acf-pro-input.js andacfe-input.js file.
Can you point me the direction?
This one: Is there an easy way to trigger your (acfe) ‘Selection Modal’ for a specific Flexible-Content field?
THX m8
Hello,
The openLayout line:839 function (latest ACF Pro version file) is in charge of openning Flexible Content layouts. Please note that I cannot provide further assistance here, as the topic is slowly sliding into custom ACF development question and this forum is dedicated to the ACF Extended plugin support.
You can try to join the ACF Support forum, they have some pretty experienced developers who may help you.
Have a nice day!
Regards.