Ejemplo n.º 1
0
        /// <summary>
        /// Resolves a parent using XPath and adds the first matched child node id to the cache.
        /// </summary>
        /// <param name="item">Defined Content Item to match</param>
        private int?ResolveItemByXPath(DefinedContentItem item)
        {
            if (item.ResolveValue.Contains("$currentPage"))
            {
                AddRelativeItemToCache(item);
                return(null);
            }

            int?resolvedNode = XPathResolver.ResolveStatic(item.ResolveValue, false);

            if (!resolvedNode.HasValue)
            {
                return(CreateItem(item));
            }
            else
            {
                return(resolvedNode.Value);
            }
        }
Ejemplo n.º 2
0
 private int?ResolveParentByXPath(DefinedContentItem item)
 {
     return(XPathResolver.ResolveStatic(item.Parent));
 }