admin管理员组文章数量:1122832
I have a "custom/section" block with a template of "allowedBlocks"
innerblocks eg. { children }
.
But have been unable to restrict the "custom/section" block from having a Parent block.
I've tried the following settings in the "custom/section" block.json
metadata.
{ "parent":[], "ancestor":[] }
//
{ "parent":[""], "ancestor":[""] }
//
{ "parent":["core/post-content"], "ancestor":["core/post-content"] }
This restricts insertion but does not restrict the block from being wrapped in a core/group
via the editor ⋮ block settings.
Multiple instances of the "custom/section" block are allowed so contentOnly
lock isn't appropriate.
references:
- gutenberg/issues/7845
- stackoverflow: how-to-exclude-parent-block-from-group-columns-innerblocks
本文标签: Restrict Block from having a Parent or Ancenstor Block
版权声明:本文标题:Restrict Block from having a Parent or Ancenstor Block 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736299491a1930471.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论