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 1461 posts 1883 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 4026 posts 15836 karma points MVP 13x 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 1461 posts 1883 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 430 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.

     

Please Sign in or register to post replies

Write your reply to:

Draft