Computer Magic Logo
Get all content by alias name

Tuesday, April 26, 2016

Published by Aristotelis Pitaridis

The code below demonstrates how to get all the descendants of a specific node for a specific document type.

foreach (var item in ((IPublishedContent)Umbraco.Content(1069)).Descendants().Where(m => m.DocumentTypeAlias.Equals("shop")))
{
}