-
-
Save markhowellsmead/c254c68cf5eaa15b287aa8766ec660d9 to your computer and use it in GitHub Desktop.
Tabs with content block
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
import { __, _x } from '@wordpress/i18n'; | |
import { InnerBlocks } from '@wordpress/block-editor'; | |
import { registerBlockType } from '@wordpress/blocks'; | |
import { group as icon } from '@wordpress/icons'; | |
registerBlockType('sht/tabswithcontent', { | |
title: __('Reitergruppe', 'sha'), | |
description: __( | |
'Eine Reitergruppe beinhaltet mehrere Reiter, um Inhalt auf der Website zu gruppieren.', | |
'sha' | |
), | |
icon, | |
category: 'sht/blocks', | |
supports: { | |
group: false, | |
mode: false, | |
html: false, | |
}, | |
edit: () => { | |
return [ | |
<div className='b-tabswithcontent'> | |
<div className='b-tabswithcontent__inner' data-tabswithcontent-inner> | |
<InnerBlocks | |
allowedBlocks={['sht/tabwithcontent']} | |
template={[['sht/tabwithcontent']]} | |
/> | |
</div> | |
</div>, | |
]; | |
}, | |
save() { | |
return ( | |
<div className='b-tabswithcontent' data-tabswithcontent> | |
<div className='b-tabswithcontent__inner' data-tabswithcontent-inner> | |
<InnerBlocks.Content /> | |
</div> | |
</div> | |
); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment