Skip to content

Commit

Permalink
Render group of blocks as section, article, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Sep 29, 2020
1 parent bbe8939 commit 765b513
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/components/manage/Blocks/Group/Schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const Schema = {
'placeholder',
'instructions',
'allowedBlocks',
'as',
'required',
'fixed',
'disableNewBlocks',
Expand Down Expand Up @@ -36,6 +37,20 @@ const Schema = {
type: 'string',
widget: 'richtext',
},
as: {
title: 'HTML5 element',
description: 'Select HTML5 element to be used for this block',
type: 'string',
factory: 'Choice',
default: 'div',
choices: [
['div', 'div'],
['section', 'section'],
['article', 'article'],
['aside', 'aside'],
['details', 'details'],
],
},
required: {
title: 'Required',
description: "Don't allow deletion of this block",
Expand Down
2 changes: 1 addition & 1 deletion src/components/manage/Blocks/Group/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { RenderBlocks } from '@eeacms/volto-blocks-form/components';

const View = (props) => {
const { data } = props;
return <RenderBlocks {...props} content={data?.data || {}} />;
return <RenderBlocks as={data?.as} {...props} content={data?.data || {}} />;
};

export default View;

0 comments on commit 765b513

Please sign in to comment.