1
- import { UMB_BLOCK_ENTRY_CONTEXT } from '@umbraco-cms/backoffice/block' ;
2
1
import { css , customElement , html , property , state } from '@umbraco-cms/backoffice/external/lit' ;
3
2
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element' ;
3
+ import { UMB_BLOCK_ENTRY_CONTEXT } from '@umbraco-cms/backoffice/block' ;
4
+ import type { UmbBlockDataType } from '@umbraco-cms/backoffice/block' ;
5
+
6
+ import '@umbraco-cms/backoffice/ufm' ;
4
7
5
8
/**
6
9
* @element umb-ref-list-block
@@ -11,6 +14,9 @@ export class UmbRefListBlockElement extends UmbLitElement {
11
14
@property ( { type : String } )
12
15
label ?: string ;
13
16
17
+ @state ( )
18
+ _content ?: UmbBlockDataType ;
19
+
14
20
@state ( )
15
21
_workspaceEditPath ?: string ;
16
22
@@ -19,6 +25,14 @@ export class UmbRefListBlockElement extends UmbLitElement {
19
25
20
26
// UMB_BLOCK_LIST_ENTRY_CONTEXT
21
27
this . consumeContext ( UMB_BLOCK_ENTRY_CONTEXT , ( context ) => {
28
+ this . observe (
29
+ context . content ,
30
+ ( content ) => {
31
+ this . _content = content ;
32
+ } ,
33
+ 'observeContent' ,
34
+ ) ;
35
+
22
36
this . observe (
23
37
context . workspaceEditContentPath ,
24
38
( workspaceEditPath ) => {
@@ -30,10 +44,11 @@ export class UmbRefListBlockElement extends UmbLitElement {
30
44
}
31
45
32
46
override render ( ) {
33
- return html `<uui- ref- node
34
- stand alone
35
- .name = ${ this . label ?? '' }
36
- href= ${ this . _workspaceEditPath ?? '#' } > </ uui- ref- node> ` ;
47
+ return html `
48
+ <uui- ref- node stand alone href= ${ this . _workspaceEditPath ?? '#' } >
49
+ <umb- ufm- render inline .markdown = ${ this . label } .value = ${ this . _content } > </ umb- ufm- render>
50
+ </ uui- ref- node>
51
+ ` ;
37
52
}
38
53
39
54
static override styles = [
0 commit comments