admin管理员组文章数量:1208155
So I have this block that I created using templates and InnerBlocks, it's a block that my authors will use to insert a Hero Image section at the top of the page.
export default function Edit() {
const template = [
[ 'core/cover', {}, [
[ 'core/heading', { placeholder: 'Section title' } ],
[ 'core/button', { placeholder: 'Call to action' } ],
] ],
];
return (
<InnerBlocks
template={ template }
templateLock='all'
/>
);
}
It works fine, however, I want to disable some attributes from the Heading and Button child blocks, so that all the author does is enter content, no styling changes to the blocks.
Why do I need that? Because this section already has all the styling it needs, and I wouldn't want my authors to change some alignment or text color that would break the section styling.
Is there any way of doing this?
I tried this but didn't work:
const template = [
[ 'core/cover', {}, [
[ 'core/heading', { placeholder: 'Section title' } ],
[ 'core/button', { placeholder: 'Call to action', supports: { align: false, ... } ],
] ],
];
本文标签: pluginsHow can I disable an attribute from a Gutenberg block included in a template via InnerBlocks
版权声明:本文标题:plugins - How can I disable an attribute from a Gutenberg block included in a template via InnerBlocks? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738686597a2106855.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论