-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested inner blocks #230
Comments
I think I had to do this due to group/column blocks. Check out #159 for more details. This feature wasn't released til v3 so I'm open to changing it/making it better – I just want to make sure it keeps support for everything.
ACF Composer has outgrown the README. I plan to put up real docs soon. |
I was about to make some tests to see if uncollapsing the collection was also working with groups and columns. Then I realized there is a very simple reason why we can't use the slugs as keys. This would not work because of the duplicated key: 'innerBlocks' => [
'core/heading' => ['placeholder' => 'Hello World'],
'core/paragraph' => ['placeholder' => 'This is the first paragraph'],
'core/paragraph' => ['placeholder' => 'This is the second paragraph'],
], This does: 'innerBlocks' => [
['core/heading' => ['placeholder' => 'Hello World']],
['core/paragraph' => ['placeholder' => 'This is the first paragraph']],
['core/paragraph' => ['placeholder' => 'This is the second paragraph']],
], |
Hi @Log1x,
I would like to build a block that is based on the
core/media-text
block. I didn't find any documentation about this but after digging into the source code I found out that it was possible to do so using aninnerBlock
property. My first attempt was to use it like below:Because of the line that collapses the collection here it is necessary to wrap each block into a single array to make it work.
If I remove the
collapse()
method the first approach works fine. So I'm just wondering if it is here for a reason? If not, should we remove it?Cheers, and thank you for this awesome package! 🚀
The text was updated successfully, but these errors were encountered: