IPublishedContentCache contentCache = context.UmbracoContext.Content;
var rootNodes = contentCache.GetAtRoot();
if (rootNodes is not null && rootNodes.Any())
{
foreach (var node in rootNodes)
{
var productPages = node.Descendants<ProductPage>().ToList();
}
}
Can you get all Published nodes that inherit from a given doc type?
Hi guys.
Using Umbraco V10
I know this will give me all the nodes at the root of the content tree:
Is there a way to get all child nodes that inherit from a given docType?
I think this will get you started.
is working on a reply...