Skip to content

Instantly share code, notes, and snippets.

@jbreuer
Last active November 12, 2018 14:51
Show Gist options
  • Save jbreuer/956aeb77c0c679f44cc0 to your computer and use it in GitHub Desktop.
Save jbreuer/956aeb77c0c679f44cc0 to your computer and use it in GitHub Desktop.
Get current domain root node in Umbraco content finder
public class NewsContentFinder : IContentFinder
{
public bool TryFindContent(PublishedContentRequest contentRequest)
{
if (contentRequest != null && contentRequest.HasDomain)
{
var rootDomainNode = contentRequest.RoutingContext.UmbracoContext.ContentCache.GetById(contentRequest.Domain.RootNodeId);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment