Not an urgent issue or anything but I was wondering if the following was possible.
If you are taking advantage of the amazing models builder and composition in latest versions of Umbraco, can you easily find all descendent of a node that inherit from a certain document type.
For example,
If you had a NewsArticleBase document type then had 2 or 3 different full News Article types, for example, ShortNewsArticle, MediaNewsArticle, DownloadNewsArticle that (for ordering purposes) were stored under repostiories.
Could you select all decendents of "News" that inhertited from "NewsArticleBase" so you would have to go through each of the sub repostories?
(hope that makes some sense, being honest, I've not tried anything yet as it was just an idea I'm planning on looking into)
Document Type Composition/Inheritance Question
Hey Peeps,
Not an urgent issue or anything but I was wondering if the following was possible.
If you are taking advantage of the amazing models builder and composition in latest versions of Umbraco, can you easily find all descendent of a node that inherit from a certain document type.
For example,
If you had a NewsArticleBase document type then had 2 or 3 different full News Article types, for example, ShortNewsArticle, MediaNewsArticle, DownloadNewsArticle that (for ordering purposes) were stored under repostiories.
Could you select all decendents of "News" that inhertited from "NewsArticleBase" so you would have to go through each of the sub repostories?
(hope that makes some sense, being honest, I've not tried anything yet as it was just an idea I'm planning on looking into)
Thanks,
Nik
Hey Nik,
Yep you can do this using the generic IPublishedContent extension methods for example:
https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web/PublishedContentExtensions.cs#L1769
Hope this helps & Merry Christmas.
Tom
is working on a reply...