Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1347 posts 1608 karma points
    Nov 14, 2012 @ 12:28
    Gordon Saxby
    0

    Problem with uQuery in umbraco 4.9.1

    I have the following :

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using umbraco.MacroEngines;
    @using Gazelle.Web.DocumentTypes;
    @using Vega.USiteBuilder;
    @using uComponents.Core
    @using uComponents.Core.uQueryExtensions
    @{
    var homeNode = umbraco.uQuery.GetCurrentNode().GetAncestorNodes().Where(x => x.NodeTypeAlias == "SiteRoot").FirstOrDefault();
    }

    which compiles / looks OK in Visual Studio, but when I run it I get the following error:

    The call is ambiguous between the following methods or properties: 'uComponents.Core.uQueryExtensions.NodeExtensions.GetAncestorNodes(umbraco.NodeFactory.Node)' and 'umbraco.NodeExtensions.GetAncestorNodes(umbraco.NodeFactory.Node)' 

    How might I fix that?!

     

     

  • Lee Kelleher 3945 posts 15163 karma points MVP 10x admin c-trib
    Nov 14, 2012 @ 13:00
    Lee Kelleher
    0

    Hi Gordon,

    Try removing the reference for "uComponents.Core.uQueryExtensions", as uQuery is now part of the Umbraco core, (under the "umbraco" namespace).

    Cheers, Lee.

  • Gordon Saxby 1347 posts 1608 karma points
    Nov 14, 2012 @ 13:22
    Gordon Saxby
    0

    That worked - although VS complains that GetAncestorNodes() until I compile - then it seems fine!? Weird

  • Sébastien Richer 194 posts 429 karma points
    Nov 14, 2012 @ 15:19
    Sébastien Richer
    0

    Godron, is that a macro script? Why not simply use:

    var root = CurrentModel.AncestorOrSelf("SiteRoot");

    Not familiar with uQuery.

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies