The reason I need to get this, is so that I can match the name of a specific alias/property elsewhere in my own configuration node.
Is this possible? I’ve tried all sorts of different contexts. I.e Block, Modal, Document, but cannot seem get hold of this alias. The closest I got was using the UMB_BLOCK_WORKSPACE_CONTEXT’s .getName() method, but this returns “‘block name content element type here…’”
I once wrote a condition for a workspace view if it should be displayed or not, based on the content type alias (on in this case if the document implements a specific composition) of the current document. I think the logic will apply to you as well:
import { UMB_CONTENT_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/content';
/**
* Represents an Umbraco condition that checks if the current content implements the content expiration composition
*/
export class ContentExpirationCondition extends UmbConditionBase<ContentExpirationConditionConfig> implements UmbExtensionCondition {
constructor(host: UmbControllerHost, args: UmbConditionControllerArguments<ContentExpirationConditionConfig>) {
super(host, args);
this.consumeContext(UMB_CONTENT_WORKSPACE_CONTEXT, (instance) => {
this.observe(instance.structure.contentTypeAliases, (aliases) => {
if (aliases.includes('expiringContent')) {
this.permitted = true;
} else {
this.permitted = false;
}
});
});
}
}
I’ve tested out your logic, and it works great… but unfortunately not when the custom property editor exists on a document type that is added via a Block List.