-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block preview not working with site editor #180
Comments
This is due to Gutenberg's Since in site editor it's not running in a post, instead of a valid post_id, it sends the template part name instead, like A quick fix for making Genesis Custom Blocks work is to add a dummy <ServerSideRender
block={ `genesis-custom-blocks/${ block.name }` }
attributes={ blockProps.attributes }
className="genesis-custom-blocks-editor__ssr"
httpMethod="POST"
urlQueryArgs={ { post_id: 0,
inner_blocks: innerBlocks ? encodeURIComponent( serialize( innerBlocks ) ) : '',
} }
/> Here : genesis-custom-blocks/js/src/block-editor/components/edit.js Lines 123 to 132 in 936b6c7
To try in the built version of This souldn't have too much impact if you're not fetching post data in your custom blocks I think… But it's a nice workaround instead of the error banner. Of course, a proper solution is to be made. |
Hello, I like to cast my vote for an "official" update (to at least Genesis Custom Blocks Pro) to solve this issue. |
Bug summary
The block preview doesn't work when editing a template part in the site editor. I can still click in and edit the block fine. The error doesn't happen when using a pattern.
Versions
The text was updated successfully, but these errors were encountered: