Worked on content type condition

This commit is contained in:
Markus Johansson
2024-04-05 21:29:12 +02:00
parent d86beb9345
commit 2031b4f842
10 changed files with 138 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
import { ManifestWorkspaceView } from '@umbraco-cms/backoffice/extension-registry';
const workspace: ManifestWorkspaceView = {
type: 'workspaceView',
alias: 'Example.WorkspaceView.EntityContentTypeCondition',
name: "Example Workspace View With Entity Content Type Condition",
element : () => import('./workspace-view.element.js'),
meta: {
icon : 'icon-bus',
label : 'Conditional',
pathname : 'conditional'
},
conditions : [
{
alias : 'Umb.Condition.EntityContentType',
oneOf : ['29643452-cff9-47f2-98cd-7de4b6807681','media-type-1-id']
}
]
};
export const manifests = [
workspace
]

View File

@@ -0,0 +1,20 @@
import { css, html } from 'lit';
import { customElement } from 'lit/decorators.js';
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
@customElement('umb-example-entity-content-type-condition')
export class UmbWorkspaceViewElement extends UmbLitElement {
render() {
return html`<p>This is a conditional element that is only shown in workspaces based on it's entities content type.</p>`;
}
static styles = [css``];
}
export default UmbWorkspaceViewElement
declare global {
interface HTMLElementTagNameMap {
'umb-example-entity-content-type-condition': UmbWorkspaceViewElement;
}
}