From e315ae3ae1b60626d97110d81563368cca19a65b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 29 Oct 2025 20:03:18 +0100 Subject: [PATCH] Cherry picked Prevent Section URL Retention fix --- .../components/backoffice-header-sections.element.ts | 5 +++-- .../packages/core/section/extensions/section.extension.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts index ac8863326a..407ca3fa7c 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-header-sections.element.ts @@ -78,8 +78,9 @@ export class UmbBackofficeHeaderSectionsElement extends UmbLitElement { const clickedSectionAlias = manifest.alias; - // If the clicked section is the same as the current section, we just load the original section path to load the section root - if (this._currentSectionAlias === clickedSectionAlias) { + // If preventUrlRetention is set to true then go to the section root. + // Or if the clicked section is the current active one, then navigate to the section root + if (manifest?.meta.preventUrlRetention === true || this._currentSectionAlias === clickedSectionAlias) { const sectionPath = this.#getSectionPath(manifest); history.pushState(null, '', sectionPath); return; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/section/extensions/section.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/core/section/extensions/section.extension.ts index e83fffe287..c0f8f8e581 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/section/extensions/section.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/section/extensions/section.extension.ts @@ -12,4 +12,5 @@ export interface ManifestSection export interface MetaSection { label: string; pathname: string; + preventUrlRetention?: boolean; }