Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save anthonydotnet/bbffa6db42d9bc933cfde053df67571d to your computer and use it in GitHub Desktop.
Save anthonydotnet/bbffa6db42d9bc933cfde053df67571d to your computer and use it in GitHub Desktop.
public IPublishedContent GetGlobalContentNode()
{
var settingsNode = GetNonPageContentNode();
//Get the child folder node - Configuration Folder
var configFolder = settingsNode.Children.SingleOrDefault(x => x.DocumentTypeAlias == Constants.DocTypes.SiteConfigurationFolder);
if (configFolder == null) { return null; }
//Try & get the child External Services node
var globalContentNode = configFolder.Children.SingleOrDefault(x => x.DocumentTypeAlias == Constants.DocTypes.GlobalContent);
return globalContentNode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment