Block Custom View
Bring your own representation for Blocks.
The Block Custom View extension type lets you define a Web Component for representing blocks.
Build a Custom View
Make a Document Type with a Property using a Block Editor of choice.
Configure at least one Block Type on the Block Editor.
Ensure the Element Type of the Blocks Content Model has a property using
headlineas the Property Alias.Take note of the Element Type Alias as you will use that in the next step.
Create a Settings Model for the above Element Type and add a property with alias
theme.Add the following code to the
umbraco-package.jsonfile:
{
"$schema": "../../umbraco-package-schema.json",
"name": "My.CustomViewPackage",
"version": "0.1.0",
"extensions": [
{
"type": "blockEditorCustomView",
"alias": "my.blockEditorCustomView.Example",
"name": "My Example Custom View",
"element": "/App_Plugins/block-custom-view/dist/example-block-custom-view.js",
"forContentTypeAlias": "myElementTypeAlias", // insert element type alias here
"forBlockEditor": "block-list" // insert block type(s) here
}
]
}The code of your Web Component could look like this:
Last updated
Was this helpful?