To allow Gutenberg blocks on your page, you'll need to do two things:
.graphql file which selects the contentBlocks field from the your post type.contentBlocks field to the blocks prop of the <ContentBlocks /> component.The ContentBlocks component is much like InnerBlocks, except that blocks are passed in as an array, rather than implictly.
query Page($postId: ID!) {
page(id: $postId, idType: DATABASE_ID) {
title
slug
template {
templateName
}
contentBlocks
}
}
import { Container } from "@components/layout/Grid"
import { defineView } from "eddev/views"
import { ContentBlocks } from "eddev"
export default defineView("page", (props) => {
return (
<Container>
<h1>{props.title!}</h1>
<ContentBlocks blocks={props.page?.contentBlocks} />
</Container>
)
})