• Resolved manojrwlsr

    (@manojrwlsr)


    Hi

    I am creating custom blocks in Gutenberg and I am trying to add leadin/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 of WpBlocksApi 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]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support harthur90

    (@harthur90)

    We do not support FullSiteEditor due to some global variables we reference inside our block not being available when inside an Iframe

    We currently don’t have a timeline of when we gonna support Full site editor mode

    Best Regards,

    Thread Starter manojrwlsr

    (@manojrwlsr)

    Hey harthur90,

    Isn’t there any way we can use leadin block in Full Site Editor please? There must be some solution for this no. It is really very frustrating as most of my code in in templates only.

    Please guide me!

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.