diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.ts index a495bbab47..8e2f5ee4fe 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.ts @@ -137,6 +137,9 @@ export class UmbContentTypeDesignEditorPropertiesElement extends UmbLitElement { @state() private _ownerContentTypeVariesByCulture?: boolean; + @state() + private _ownerContentTypeVariesBySegment?: boolean; + @state() private _newPropertyPath?: string; @@ -179,6 +182,13 @@ export class UmbContentTypeDesignEditorPropertiesElement extends UmbLitElement { }, 'observeOwnerVariesByCulture', ); + this.observe( + workspaceContext.variesBySegment, + (variesBySegment) => { + this._ownerContentTypeVariesBySegment = variesBySegment; + }, + 'observeOwnerVariesBySegment', + ); }); this.observe(this.#propertyStructureHelper.propertyStructure, (propertyStructure) => { this._properties = propertyStructure; @@ -268,7 +278,8 @@ export class UmbContentTypeDesignEditorPropertiesElement extends UmbLitElement { ?sort-mode-active=${this._sortModeActive} .propertyStructureHelper=${this.#propertyStructureHelper} .property=${property} - .ownerVariesByCulture=${this._ownerContentTypeVariesByCulture}> + .ownerVariesByCulture=${this._ownerContentTypeVariesByCulture} + .ownerVariesBySegment=${this._ownerContentTypeVariesBySegment}> `; }, diff --git a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.ts b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.ts index 826d9927ce..ce58e2405b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.ts @@ -65,6 +65,9 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { @property({ attribute: false }) public ownerVariesByCulture?: boolean; + @property({ attribute: false }) + public ownerVariesBySegment?: boolean; + @property({ type: Boolean, reflect: true, attribute: '_inherited' }) public _inherited?: boolean; @@ -330,7 +333,12 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { #renderVariantTags() { if (!this.property) return nothing; - if (!this.property.variesByCulture && !this.property.variesBySegment) { + if ( + this.ownerVariesByCulture && + this.ownerVariesBySegment && + !this.property.variesByCulture && + !this.property.variesBySegment + ) { return html` ${this.localize.term( @@ -340,28 +348,20 @@ export class UmbContentTypeDesignEditorPropertyElement extends UmbLitElement { `; } - return html` - ${this.property.variesByCulture - ? html` - ${this.localize.term('contentTypeEditor_cultureVariantLabel')} - ` - : html` - ${this.localize.term( - 'contentTypeEditor_cultureInvariantLabel', - )} - `} - ${this.property.variesBySegment - ? html` - ${this.localize.term('contentTypeEditor_segmentVariantLabel')} - ` - : html` - - ${this.localize.term( - 'contentTypeEditor_segmentInvariantLabel', - )} - - `} - `; + if (this.ownerVariesByCulture && this.property.variesByCulture && !this.property.variesBySegment) { + return html` + ${this.localize.term('contentTypeEditor_cultureInvariantLabel')} + `; + } + + if (this.ownerVariesBySegment && !this.property.variesByCulture && this.property.variesBySegment) { + return html` + ${this.localize.term('contentTypeEditor_segmentInvariantLabel')} + `; + } + + // Not shared: + return nothing; } static override styles = [