Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 5814fba

Browse files
committed
more code
1 parent e418c00 commit 5814fba

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { UmbTextStyles } from '@umbraco-cms/backoffice/style';
2+
import { html, customElement, LitElement, property, css } from '@umbraco-cms/backoffice/external/lit';
3+
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
4+
import type { UmbBlockDataType, UmbBlockEditorCustomViewElement } from '@umbraco-cms/backoffice/extension-registry';
5+
6+
@customElement('example-block-custom-view')
7+
export class ExampleBlockCustomView extends UmbElementMixin(LitElement) implements UmbBlockEditorCustomViewElement {
8+
//
9+
@property({ attribute: false })
10+
content?: UmbBlockDataType;
11+
12+
override render() {
13+
return html`
14+
<div class="uui-text">
15+
<h5 class="uui-text">My Custom View</h5>
16+
<p>Headline: ${this.content.headline}</p>
17+
</div>
18+
`;
19+
}
20+
21+
static override styles = [
22+
UmbTextStyles,
23+
css`
24+
:host {
25+
display: block;
26+
height: 100%;
27+
box-sizing: border-box;
28+
background-color: #dddddd;
29+
border-radius: 9px;
30+
padding: 12px;
31+
}
32+
`,
33+
];
34+
}
35+
36+
export default ExampleBlockCustomView;
37+
38+
declare global {
39+
interface HTMLElementTagNameMap {
40+
'example-block-custom-view': ExampleBlockCustomView;
41+
}
42+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { ManifestBlockEditorCustomView } from '@umbraco-cms/backoffice/extension-registry';
2+
3+
export const manifests: Array<ManifestBlockEditorCustomView> = [
4+
{
5+
type: 'blockEditorCustomView',
6+
alias: 'Umb.blockEditorCustomView.TestView',
7+
name: 'Block Editor Custom View Test',
8+
element: () => import('./block-custom-view.js'),
9+
forContentTypeAlias: 'headlineUmbracoDemoBlock',
10+
forBlockEditor: 'block-grid',
11+
},
12+
];

0 commit comments

Comments
 (0)