From 7af67d294462cf1e99877ef662981461e0dc7189 Mon Sep 17 00:00:00 2001 From: Lucas Bach Bisgaard Date: Wed, 29 Oct 2025 20:00:36 +0100 Subject: [PATCH] =?UTF-8?q?Have=20to=20control=20of=20the=20state=20store?= =?UTF-8?q?=20navigation=20for=20custom=20sections=20or=20=E2=80=A6=20(#20?= =?UTF-8?q?637)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Have to control of the state store navigation for custom sections or overrides * revert wording * move logic and update comment --------- Co-authored-by: Lucas Bach Bisgaard Co-authored-by: Niels Lyngsø --- .../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 117867336b..d75a4ee5a6 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 @@ -83,8 +83,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 b3d90397f5..cb64f73dc6 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; }