Skip to content

Commit 98da567

Browse files
committed
add setting value
1 parent 94b8897 commit 98da567

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

16/umbraco-cms/customizing/extending-overview/extension-types/block-custom-view.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ You can also refer to the tutorial [Custom Views for Block List](https://docs.um
1717
2. Configure at least one Block Type on the Block Editor.
1818
3. Ensure the Element Type of the Blocks Content Model has a property using `headline` as the Property Alias.
1919
4. Take note of the Element Type Alias as you will use that in the next step.
20-
5. Add the following code to the `umbraco-package.json` file:
20+
5. Create a Settings Model for the above Element Type and add a property with alias `theme`.
21+
6. Add the following code to the `umbraco-package.json` file:
2122

2223
{% code title="umbraco-package.json" %}
2324
```json
@@ -32,7 +33,7 @@ You can also refer to the tutorial [Custom Views for Block List](https://docs.um
3233
"name": "My Example Custom View",
3334
"element": "/App_Plugins/block-custom-view/dist/example-block-custom-view.js",
3435
"forContentTypeAlias": "myElementTypeAlias", // insert element type alias here
35-
"forBlockEditor": "block-list" // insert block type here
36+
"forBlockEditor": "block-list" // insert block type here
3637
}
3738
]
3839
}
@@ -54,10 +55,14 @@ export class ExampleBlockCustomView extends UmbElementMixin(LitElement) implemen
5455
@property({ attribute: false })
5556
content?: UmbBlockDataType;
5657

58+
@property({ attribute: false })
59+
settings?: UmbBlockDataType;
60+
5761
render() {
5862
return html`
5963
<h5>My Custom View</h5>
6064
<p>Headline: ${this.content?.headline}</p>
65+
<p>Theme: ${this.settings?.theme}</p>
6166
`;
6267
}
6368

0 commit comments

Comments
 (0)