admin管理员组文章数量:1128331
I've had a problem blocking me for days...
I have extended the core block 'core/group'. The extension inserts an (overlay) div into the container and wraps the InnerBlocks into another div so that the structure looks like this
<div>
<div>overlay</div>
<div class="wrapper">
... InnerBlocks
</div>
</div>
I use 3 filter hooks for this:
'blocks.getSaveElement'. Here the structure is modified before saving. This works without any problems by cloning the passed element and modifying it accordingly.
'blocks.registerBlockType'. Here I add the additional attributes... also non-critical
'editor.BlockEdit'. Here the controls for the InspectorControls are added to fill the attributes. This also works without any problems... However, the filter function is given an object 'BlockEdit', which looks like a functional component that is created by the edit function. This component cannot be modified because it does not have static content but only creates it when it is executed.
When I try to run the component and output the content (a fragment with two elements) along with the additional controls, it has no effect. Therefore it is apparently not possible to bring the changes that work in the frontend into the editor.
The documentation is superficial and not really helpful. I couldn't find any working examples.
Hence my call for help at this point... Does anyone know of a working example or knows how I can make the block's structural changes visible in the block editor too
本文标签: HowTo modify BlockEditComponent in FilterHooks for coreblock Extensions
版权声明:本文标题:HowTo modify BlockEdit-Component in Filter-Hooks for core-block Extensions 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736717985a1949307.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论