Skip to content

Instantly share code, notes, and snippets.

@StefanoChiodino
Created August 31, 2017 14:42
Show Gist options
  • Save StefanoChiodino/9dc609842ad1c202e761b7319c7dbcd2 to your computer and use it in GitHub Desktop.
Save StefanoChiodino/9dc609842ad1c202e761b7319c7dbcd2 to your computer and use it in GitHub Desktop.
private static string GetSingleNode(string modelTypeAlias)
{
var node = UmbracoContext.Current.ContentCache
.GetSingleByXPath($"//{modelTypeAlias}[@isDoc]");
var url = node
?.Url;
return url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment