Home › Forums › Gutenberg › How to allow Inner Blocks with ACF in Gutenberg › Reply To: How to allow Inner Blocks with ACF in Gutenberg
Hi everyone,
just wanted to chime in and tell you that I’ve managed to use ACF with innerblocks. My use case is a “Text” Block which wrapps all other textish blocks (paragraph, heading, list) for a common wrapper (container, margins/paddings – all design reasons).
I’m using this helper methods and the editor.BlockEdit und blocks.getSaveElement hooks to overwrite the save & edit components of acf blocks. You can see it in this gist.
It’s kinda hacky, works only until ACF 5.8.2 (have to find out what’s breaking it in 5.8.3). But with mode set to preview, the fields only showing in the sidebar and some styling I managed to get it working for editors/normal users.
I’m also working on adding custom fields to core blocks – have a proof of concept which adds fields to core/paragraph but not saving correctly atm. If anyone wants to help/the code I’ll set it up as a github repo.
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.