public static IEnumerable<dynamic> GetInternalLinkNodes(dynamic linksProperty) { var nodes = new List<dynamic>(); var library = new RazorLibraryCore(Node.GetCurrent()); dynamic links = linksProperty.BaseElement.Elements("link"); foreach (dynamic link in links) { if (link.Attribute("type").Value == "internal") { int relatedNodeId = int.Parse(link.Attribute("link").Value); nodes.Add(library.NodeById(relatedNodeId)); } } return nodes; }
public static IEnumerable<string> GetInternalLinkUrls(dynamic linksProperty) { var urls = new List<string>(); var library = new RazorLibraryCore(Node.GetCurrent()); dynamic links = linksProperty.BaseElement.Elements("link"); foreach (dynamic link in links) { if (link.Attribute("type").Value == "internal") { int relatedNodeId = int.Parse(link.Attribute("link").Value); dynamic relatedNode = library.NodeById(relatedNodeId); urls.Add((string)relatedNode.Url); } } return urls; }