diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.ts index f8671c248d..db0744379d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.ts @@ -116,9 +116,6 @@ export class UmbPropertyEditorUIBlockListElement extends UmbLitElement implement @state() private _catalogueRouteBuilder?: UmbModalRouteBuilder; - @state() - private _directRoute?: string; - #context = new UmbBlockListManagerContext(this); constructor() { @@ -179,10 +176,13 @@ export class UmbPropertyEditorUIBlockListElement extends UmbLitElement implement } render() { + let createPath: string | undefined; if (this._blocks?.length === 1) { const elementKey = this._blocks[0].contentElementTypeKey; - this._directRoute = + createPath = this._catalogueRouteBuilder?.({ view: 'create', index: -1 }) + 'modal/umb-modal-workspace/create/' + elementKey; + } else { + createPath = this._catalogueRouteBuilder?.({ view: 'create', index: -1 }); } return html` ${repeat( this._layouts, @@ -198,7 +198,7 @@ export class UmbPropertyEditorUIBlockListElement extends UmbLitElement implement id="add-button" look="placeholder" label=${this._createButtonLabel} - href=${this._directRoute ?? this._catalogueRouteBuilder?.({ view: 'create', index: -1 }) ?? ''}> + href=${createPath ?? ''}>