Support

Account

Home Forums Gutenberg How to allow Inner Blocks with ACF in Gutenberg

Solving

How to allow Inner Blocks with ACF in Gutenberg

  • 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?:

    https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/components/inner-blocks/README.md

    • NickDA

    • November 30, 2018 at 11:53 am

    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!

    • jurky

    • December 9, 2018 at 10:10 am

    Yes, please! The plugin won’t reach its potential until this is implemented.

    • canet

    • January 8, 2019 at 2:12 am

    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!!! ๐Ÿ™‚

    • sebfck

    • January 12, 2019 at 10:18 am

    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.

    • ryan62

    • January 18, 2019 at 7:30 am

    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.

    • alicam

    • January 22, 2019 at 4:36 pm

    @ryan62 I have been thinking about the same thing! It’s a critical need right now. I can’t believe it’s so hard!!

    Please, Elliott and team, THIS IS A REALLY URGENT NEED!

  • 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โ€ฆ

    • alicam

    • February 8, 2019 at 9:14 am

    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!!

    A

    • jurky

    • February 20, 2019 at 11:05 pm

    @alicam

    Hm, so we’re probably not getting this? 99% of the websites nowadays need this thing, so we have to come up with something. There’s no point in replacing a page builder without this feature.

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.