Get document type alias in a datasource when creating a content #414
-
Hi, 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.
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.
@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
IContentmentContentContext
itself is a slight hack, in that it uses data from the URL's querystring (the current or parent page ID), which is fine for the majority of cases. But as you say, not ideal when requiring the current page's Document Type.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 Contentme…