Closed marcbelletre closed 3 months ago
If I remove the collapse() method the first approach works fine.
I think I had to do this due to group/column blocks. Check out https://github.com/Log1x/acf-composer/pull/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.
I didn't find any documentation about this
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! 🚀