if I put a Cloned CF in a Repeater, the repeater can’t find fields to use for the collpased state (it just sees the clone field which of course has no data itself). It would be good if it could find at least one level of subfields to use for the collapsed state
This is due to the way that the clone field works. The best advice I can give you is to submit a support ticket https://support.advancedcustomfields.com/new-ticket/
I was having the same issue because I am using cloned field groups quite heavily. But I discovered a work around.
1. Set the Collapsed field value in the Repeater to your cloned field.
2. In your cloned field group add the class “-collapsed-target” to the field you want to show when the repeater is collapsed.
Also, if you have multiple fields per row, one (or more) of which you want to display when the repeater is collapsed, add the “-collapsed-target” class to ALL the fields you want displayed. Just make sure they don’t add up to more than 100% width. I do this with a Person repeater where I show the First Name and Last Name when the repeater is collapsed.
This is definitely a hack, but for now it works.
Hey people, any news here? I tried @kensyntric-com‘s workaround, but no success 🙁 My repeater (grandfather) includes a clone (father) which includes another clone (child).
The child one has 5 sub-fields
The father has
And the grandfather only repeats father.
I would like to collapse father and show its titles, collapse child and show its Text (inside group), but I couldn’t find a way to do so, any ideas?
I abandoned the cloned fields because I needed more than just field values to show in each row. I now have links to view and edit each object, custom checkbox…the kitchen sink. I am now using custom WordPress admin lists, basically the equivalent of the Pages, Posts or Users list with filters, inline editing, sorting, etc.
If you get stuck and want to know details I’d be happy to share some code. Sorry I’m no help.
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.