Get document type alias in a datasource when creating a content #414
Replies: 1 comment
-
@Didier-Marin Unfortunately, I can't think of any meta-data that can be hooked into, to get the Document Type of a new page. The The alternative approach would be to develop your own custom property-editor to get the textbox's datalist items as an async fetch (HTTP request), then you could get the extra meta-data you need (e.g. Document Type alias or GUID) and send it to the server to gather the corresponding items. In terms of future Contentment, this might be something that could be added to version 6 (for Umbraco 14), as the architecture is slightly different, but version 5 (and below) has the limitation with the AngularJS backoffice. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm using a custom datasource for the Contentment Text input to filter the list of dictionary entries based on documenttype alias
in the GetItems method, I use
var currentContent = _contentmentContentContext.GetCurrentContent(out bool isParent);
so with currentContent.ContentType.Alias, I can get the documenttype alias
It works fine when I'm editing an existing content (then isParent = false)
But when I'm creating a new content, isParent = true and currentContent is the parent
How can I have the documenttype alias of the node I'm creating ?
Beta Was this translation helpful? Give feedback.
All reactions