The procedure is actually described in the manual: https://developer.ww.wp.xz.cn/block-editor/reference-guides/block-api/block-variations/
You must specify the “core/list” block using the examples there.
I also found this article very helpful: https://fullsiteediting.com/lessons/block-variations/
Thread Starter
fieron
(@fieron)
I’ve read all these articles. There is no answer to my question. To clarify, here is an example.
I have a variation
wp.blocks.registerBlockVariation('core/heading', {
name: 'heading-variation-1',
title: 'Heading Variation 1',
attributes: {
className: 'is-heading-variation-1',
level: 3,
},
})
Now I want to add this variation to the InnerBlocks.
const tpl = [
[ 'core/image', { } ],
…,
[ 'heading-variation-1', {}]
];
And it doesn’t work. And it doesn’t work with allowedBlocks.
What am I doing wrong? Or is there no such functionality?
It might be good to ask this very specific question to the Gutenberg team: https://github.com/WordPress/gutenberg/issues