Default Hubspot Block Issue
-
Hi
I am creating custom blocks in Gutenberg and I am trying to addleadin/hubspot-form-block
support to one of my block. It is working on post,page or custom post editor but it is not working on Full Site Editor. I am getting this => Error: Block Type leadin/huspot-form-block is not registered, after that editor screen crashes.
I am getting this particular issue on latest updated plugins, mostly on v.11. It is working fine on v.10.
I have looked into the codebase for changes and find out below bunch of changes in registerFormBlock.tsx file in gutenberg folder which is under script folder ://We do not support the full site editor: https://issues.hubspotcentral.com/browse/WP-1033
if(!wpBlocksApi || isFullSiteEditor()){
return null;
}
In newer versions block is regsitered using WpBlocksApi like below :WpBlocksApi.registerBlockType('leadin/hubspot-form-block', {
Whereas on older versions, there is no mention ofWpBlocksApi
and is registred like below :registerBlockType('leadin/hubspot-form-block', {
I am inserting this block in my custom block<InnerBlocks />
like below :import { __ } from '@wordpress/i18n';
import { InnerBlocks, RichText, useBlockProps } from '@wordpress/block-editor';
import classNames from 'classnames';
const Edit = (props) => {
const {
attributes: { eyebrow, heading },
setAttributes,
} = props;
const ALLOWED_BLOCKS = ['leadin/hubspot-form-block'];
const MY_TEMPLATE = [
['leadin/hubspot-form-block', {}],
];
const blockProps = useBlockProps({
className: classNames('sticky-form', 'is-editor'),
});
return (
<div {...blockProps}>
<div className={classNames('sticky-form__inner-wrapper')}>
<div className={classNames('sticky-form__inner')}>
<div className={classNames('sticky-form__eyebrow')}>
<RichText
value={eyebrow}
onChange={(value) => {
setAttributes({ eyebrow: value });
}}
placeholder={__('Read the guide')}
/>
</div>
<div className={classNames('sticky-form__heading')}>
<RichText
value={heading}
onChange={(value) => {
setAttributes({ heading: value });
}}
placeholder={__('Fill out the form to get instant access')}
/>
</div>
<InnerBlocks allowedBlocks={ALLOWED_BLOCKS} template={MY_TEMPLATE} />
</div>
</div>
</div>
);
};
export default Edit;
Please let me know if there’re any other way to use default hubspot block in custom gutenberg blocks.
Thank you!The page I need help with: [log in to see the link]
- You must be logged in to reply to this topic.