Today I noticed that the Repeater collapse icon is missing if the collapsed option for a repeater is not set.
Searching the support form gives me this post, where I can see that this should be a feature.
For me it’s a bug 🙂
What, if my repeater has no field that makes sense to show on collapsed state or if I don’t want that there is a field visible if the repeater is collapsed.
I believe that in older versions every repeater could be collapsed.
What’s your opinion about this?
Thomas
I’m not sure about what you’re seeing or that other post, but I have a repeater I just tested with and with or without, it also depends on the layout option set for the repeater. Displaying as a row, you can collapse the repeater even without making a selection. It is when you choose the table or block layout that you must select a field to show when the repeater is collapsed. It could be a bug, I don’t know. If you want to report this as a bug you should submit a new support ticket https://support.advancedcustomfields.com/new-ticket/
Thanks for your answer. But for me a repeater displaying as a row can’t be collapsed if no field for the select option is set. There’s no difference between row, table or block design.
Actually, you are 100% correct. I just did some testing. It appears that there is a bug in the system that let me do this, and it is a bug that works for all layout types for repeaters.
Steps to recreate
1) Create a text field in the repeater, doesn’t matter what you call it
2) Set this field as the field to show
3) delete the field you just created and selected
4) save the field group
This needs to be repeated whenever you modify the field group, and it’s probably not a good idea to depend on bugs, but I’m guessing that this one isn’t going to be corrected any time soon, especially if no one reports it since it not breaking anything.
I was curious, so I did some testing. Hack #2, add a load field filter to any repeater field.
add_filter('acf/load_field/name=my_repeater', 'make_it_collapse');
function make_it_collapse($field) {
$field['collapsed'] = 'field_whatever';
return $field;
}
The topic ‘Please make the Repeater collapse icon available’ is closed to new replies.
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.