The Issue is now fixed in version 5.4.8
“Flexible Content field: Fixed bug in ‘layout_title’ filter preventing values being loaded correctly…”
🙂
Found an Issue in function “render_layout_title” in file “acf-pro-input.js”.
The html returned upon “success” does not include the sub_field.
If I comment/remove the function:
$layout.find('> .acf-fc-layout-handle').html( html );
Then it´s working… 😉
I just tried this, and it does not work either, because the “.acf-fc-layout-handle” “cleans” the div again.. I can see the value being added to the “.acf-fc-layout-handle” for a short second and then it´s gone.. 😉
function showstopper(obj) {
obj.each(function() {
var obj = $(this);
var target = obj.closest('.layout').children('.acf-fc-layout-handle');
var value = ' <span>' + obj.find('input').val() + '</span>';
target.append(value);
});
}
acf.add_action('ready', function() {
showstopper($('.dog'));
});
acf.add_action('hide_field', function($field, context) {
showstopper($field);
});
acf.add_action('show_field', function($field, context) {
showstopper($field);
});
When I toggle a flex field the html of the div “.acf-fc-layout-handle” are “reloaded”, thats why the values disappears on click toggle..
1: Yes
2: Yes
3: Okey
It must be js issue because when I update or visit my post, the value is there, but as soon as I toggle the flex field, the text(value of the subfield) disappears from the flex field and are updated with nothing ($title = ”;)
Thanks.
Hi, thanks for your reply.
However, my database knowledge is not the best..
Although i think i found a solution to my problem.
The field_option_flexible_content “data-id”.
I know that you are not a fan of nested flexible content, but I
have no choice.
If i do like this it works:
I create 2 or more layouts of flexible content.
Then inside of flexible content layout 2 > I put the nested flexible content. Then I can have more than 1 layout of flexible content.
Flexible content layout(data-id:0)
—————–layout(data-id:1) > Flexible content layout (data-id:0)
——————————————————layout (data-id:1)
Then I just go back and delete the first empty layout.
Best regards /
Mr.
I HAVE SOLVED IT.
No button for that?
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.