Created
August 14, 2018 18:50
-
-
Save belcherj/b458cba2a26f6a98e75687b187bb42bd to your computer and use it in GitHub Desktop.
Broken 3 column layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Internal dependencies | |
*/ | |
import './style.scss'; | |
/** | |
* External dependencies | |
*/ | |
import { __ } from '@wordpress/i18n'; | |
import { registerBlockType } from '@wordpress/blocks'; | |
import { InnerBlocks } from '@wordpress/editor'; | |
const TEMPLATE = [ | |
[ 'core/heading', { | |
className: 'wp-block-wccom-three-column-header', | |
placeholder: __( 'Enter Title...', 'wccom' ), | |
} ], | |
[ 'core/columns', { className: 'wp-block-wccom-three-column-content' }, [ | |
[ 'core/column', {}, [ | |
[ 'core/heading', { placeholder: __( 'Enter Title...', 'wccom' ) } ], | |
[ 'core/paragraph', { placeholder: __( 'Enter Description...', 'wccom' ) } ], | |
] ], | |
[ 'core/column', {}, [ | |
[ 'core/heading', { placeholder: __( 'Enter Title...', 'wccom' ) } ], | |
[ 'core/paragraph', { placeholder: __( 'Enter Description...', 'wccom' ) } ], | |
] ], | |
[ 'core/column', {}, [ | |
[ 'core/heading', { placeholder: __( 'Enter Title...', 'wccom' ) } ], | |
[ 'core/paragraph', { placeholder: __( 'Enter Description...', 'wccom' ) } ], | |
] ], | |
] ], | |
]; | |
registerBlockType( 'wccom/three-column-content', { | |
title: __( 'Three Column Content', 'wccom' ), | |
icon: 'cart', | |
category: 'wccom', | |
keywords: [ | |
__( 'woo', 'wccom' ), | |
__( 'header', 'wccom' ), | |
__( 'columns', 'wccom' ), | |
], | |
edit() { | |
return ( | |
<InnerBlocks template={ TEMPLATE } /> | |
); | |
}, | |
save() { | |
return ( | |
<InnerBlocks.Content /> | |
); | |
}, | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment