Hello! I’ve been playing around with ACF’s solution to custom Gutenberg blocks and I love the flexibility… however I’m having trouble figuring out how to allow other blocks to be used inside.
For example, I want to create a simple container block which allows for customizing the background, padding, etc. for any other block (like an image or paragraph, for example).
All I could find was this… any idea on how to hook it up with ACF’s method?:
This was already suggested to Elliot on Github, and the answer we got back was that this is something he is going to look into later on, once he finishes v5.8 I guess…
Personally, and for the time being, any container needs that I have for, like sections, tabs, etc… are put on hold, except one, called “section”, where I wrap a WYSIWYG field with the container code, and as a compromise for now, I will be using shortcodes that my theme and plugins provide to populate the content of that section. Not an ideal solution, but that’s the best I could do until ACF allows inner blocks, and my guess is that this has to be a new field type that needs to be created…
Anyone else willing to share their solutions regarding this issue, will be greatly appreciated, at least by me…
Just chiming in to add my support for adding Inner Blocks as a feature for ACF Blocks! I’m looking to use blocks to create sections, too. This would be immeasurably useful. I’ll keep playing around on my own, and if I come up with any better alternatives, I will post them here.
I ran into this issue as well for a general wrapper block with default options, ACF support for innerblocks would be awesome!
Yes, please! The plugin won’t reach its potential until this is implemented.
Oh, I can see I’m not the only seeking desperately for a way to get a wrapper in ACF block!
I hope it’ll be soon implemented ’cause this feature could really get ACF to the highest levels!
Go Elliot Go!!! 🙂
Much needed feature, glad to see I’m not alone in wanting this.
Honestly I’m surprised Gutenberg didn’t ship with a row/container block. Good thing we have ACF and Elliot to save us! 😉
I’d really love to see this feature! Everything else is working great. If anyone finds a workaround in the mean time please share.
FWIW, this is admittedly very very hackish, but the way I’ve been handling this until a better solution comes in is to create a custom block (called “Section”) which has an option to set to either open or close. I then put that block before and after (set to “open” and then “close” respectively) the blocks I want to “wrap” in a section container. Then in the block template I simply render either an opening HTML tag or a closing HTML tag. I also add additional (conditional) fields to set background colour/padding and other customizable things.
Chiming in here, I would LOVE to see this. To have a container block using ACF’s super straightforward registration function would be amazing. If Gutenberg coding didn’t scare me so much, I’d try my hand at creating a very simple container block, just to have something…
Ok so I got a reply from Elliott on this.
Basically, he sees no possible way to add InnerBlock capability to a dynamically-generated block.
As you would know, all ACF blocks have to be degnerated dynamically, and as such there are limitations on what can be done, and to his mind, InnerBlocks can’t be done.
He’s open to what others may know beyond that, but frankly, that’s a little scary! I can’t see a rock solid solution if we can’t do this. There are so many applications that really need it, to my mind.
So I guess, thinking caps on, people!!
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!
Eek! 🕷🐞 A few creepy crawly bugs found their way into ACF PRO 5.7.11! We're hard at work squashing them all and will keep you updated with our progress. 🙏— Advanced Custom Fields (@wp_acf) February 12, 2019
© 2019 Advanced Custom Fields. Subscribe