Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 713 posts 954 karma points
    Jun 25, 2015 @ 00:03
    Tom
    1

    CreateXPathQuery v7

    Hi we're currently in the process of upgrading from 6.2.4->7 and it hasn't been that smooth as we went from 4->6 successfully and would now like to move to 7

    Just wondering what replaces CreateXPathQuery in v7 I noticed a Legacy Handler in the source but it is internal.

    I'm looking to replace this:

    if (HttpContext.Current != null && HttpContext.Current.Request.UrlReferrer != null)
            {
                var extensionlessAbsolutePath = Path.GetFileNameWithoutExtension(HttpContext.Current.Request.UrlReferrer.AbsolutePath);
                if (!string.IsNullOrWhiteSpace(extensionlessAbsolutePath))
                {
                    var umbracoUrlXPath = umbraco.presentation.requestHandler.CreateXPathQuery(extensionlessAbsolutePath, true);
                    var referringNode = Cms.GetContentXml().SelectSingleNode(umbracoUrlXPath);
    
                    if (referringNode != null)
                    {
                        nodeId = int.Parse(referringNode.Attributes.GetNamedItem("id").Value);
                    }
                }
            }
    
Please Sign in or register to post replies

Write your reply to:

Draft