Ecommerce Shopify WordPress Discussion

Create new gutenberg block basing on the core block

I want to create a custom gutenberg block but it should be a core block with additional text at the end. It is just example but let's say I want a new block working just like core/paragraph but it will render additional "test" string at the end. import { registerBlockType } from '@wordpress/blocks'; import { __ } from '@wordpress/i18n'; import { Panel, PanelBody, PanelRow } from '@wordpress/components'; import { useBlockProps, InnerBlocks, InspectorControls } from '@wordpress/block-editor'; import metadata from '../../config/extended-block.json'; registerBlockType( metadata, { edit: ( { attributes, setAttributes } ) => { const blockProps = useBlockProps( { className: "test_extended", style: { /* some styles based on attributes */ } } ); return <div { ...blockProps }> <InspectorControls key="settings" group="styles"> <Panel> <PanelBody title={ __( "atribute name", "test" ) } initialOpen={ false }> <PanelRow> <fieldset> {/* Some controls for changing attributes, color pallete or something */} </fieldset> </PanelRow> </PanelBody> </Panel> </InspectorControls> <div className='test_extended'> <InnerBlocks /> </div> </div> }, save: ( {attributes} ) => { const blockProps = { className: "test_extended", style: { /* some styles based on attributes */ } } ); return <div {...blockProps}> <div className='test_extended'> <InnerBlocks /> </div> </div> } } ); This is the code I use to build and register new gutenberg block. What should I do if test/extended-block is just like core/paragraph or core/group but with some additional options?
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.