Have a button that collapses / expands all flex content blocks. Ideally, all flex content blocks should start collapsed.
We’re using flex content fields to allow the client to create pages by adding flex content blocks that we’ve defined. There can be many – 10 to 20, each of which has lots of options (background image, editors, etc). The current state is that they all start off fully expanded, which makes the edit page very long and confusing. We nede a way to collapse all these fields and a way to make sure that’s how a page starts – ie with all flex content fields collapsed.
This plugin does most of the above (https://github.com/mrwweb/ACF-Repeater-Collapser/), but it doesn’t cope very well with block or table layouts.
Massive plus 1 on this. ACF Pro is able to replace horrible page builders but this issue makes it pretty rough to hand off to the client.
Thanks for proposing this.
I have passes this to Elliot so that he can look into implementing this feature on the plugin.
Thanks for the feature request.
This could be easily done by writing a small amount of JS on the page which simply loops through the flexible content layout divs, and triggers a click on the handle if it is open.
You could run this on doc ready, or just in the footer of the page.
This would be, for me, a huge feature. A built in method that the user can click a icon or double click the header and it collapses. The row collapse plugin solves some of this for now, but it doesn’t work with block layout. The row layout can get messy since the labels are to the left of the element.
I created a script for that.
Just put the script in your functions.php file.
Your link no longer works. Is there another site to download your script?
I believe you can try this code:
Please check this page to learn more about it: https://www.advancedcustomfields.com/resources/acfinputadmin_head/.
I personally didn’t want Flexible Content fields to collapse automatically, but I did want a way to do so quickly and easily. For those with similar needs, here’s how I’m handling that.
Specifically, this adds a single “Collapse All” link to the top of Flexible Content fields.
Note that this sort of thing is always subject to breaking with new ACF versions—generally you just need to keep an eye on class names.
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!
ACF Extended just passed the 8k install mark. It's so motivating to see the overwhelming positive feedbacks/reviews. The feeling of helping developers by providing solid & inovative tools is amazing 🤩— hwk (@hwkfr) March 13, 2020
Thanks everyone for your support! The coming months will be exciting! 🚀🛠️ pic.twitter.com/A7tKnWZeXT
© 2020 Advanced Custom Fields. Subscribe