Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save hermanussen/f300228ee5d5bba659b17ec6ae6aa748 to your computer and use it in GitHub Desktop.

Select an option

Save hermanussen/f300228ee5d5bba659b17ec6ae6aa748 to your computer and use it in GitHub Desktop.
private bool InheritsFromTemplate(TemplateItem templateItem, Sitecore.Data.ID templateId)
{
return templateItem.ID == templateId
|| (templateItem.BaseTemplates != null
&& templateItem.BaseTemplates
.Where(baseTempl => InheritsFromTemplate(baseTempl, templateId)).Count() > 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment