Copied to clipboard

Flag this post as spam?

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


  • Connie DeCinko 931 posts 1160 karma points
    Jun 14, 2011 @ 00:21
    Connie DeCinko
    0

    uQuery and uComponents Extensions - Where are the examples?

    I'm trying to use uQuery and uComponents Extensions but it's nearly impossible with zero documentation and no examples.  I've looked at the information on the uComponents section but it only has basic information about the commands, not about how to use them, what they require, what they produce.

     

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Jun 14, 2011 @ 01:34
    Bo Damgaard Mortensen
    0

    Hi Connie,

    I think Lee Kelleher made quite a good effort to document uComponents. Have you had a peek at the codeplex site? :-)

    uQuery helper methods overview: http://ucomponents.codeplex.com/wikipage?title=uQuery

    uComponents DataTypes, Extensions etc.: http://ucomponents.codeplex.com/documentation

    All the best,

    Bo

  • Connie DeCinko 931 posts 1160 karma points
    Jun 14, 2011 @ 17:14
    Connie DeCinko
    0

     Yeah, I've looked at those pages many times and they are pretty worthless for someone new to this and new to XML.  There are no examples, only code fragments.  So far all of the code that seems similar fails to deliver the correct results. 

    I'll begin sharing what does NOT work in the hopes someone can shed some light or I can help another from wasting as much time as I have chasing a ghost.

     

  • Connie DeCinko 931 posts 1160 karma points
    Jun 14, 2011 @ 17:16
    Connie DeCinko
    0

    Simple example, never returns the page property, but instead returns "umbraco.presentation.nodeFactory.Property".

              var currentNode = uQuery.GetCurrentNode().GetAncestorOrSelfNodes().FirstOrDefault();
                string activeMenu = currentNode.GetProperty("activeMenu").ToString();
    
                Response.Write(activeMenu);
    
  • Connie DeCinko 931 posts 1160 karma points
    Jun 14, 2011 @ 17:44
    Connie DeCinko
    0

    Similar approach, does not work either:

              var currentNode = uQuery.GetCurrentNode().GetAncestorOrSelfNodes().FirstOrDefault();
                string activeMenu = currentNode.GetProperty("activeMenu").Value.ToString();
    
                if (activeMenu != null)
                    Response.Write(activeMenu);
                else
                    Response.Write("none");
    
  • Connie DeCinko 931 posts 1160 karma points
    Jun 14, 2011 @ 17:45
    Connie DeCinko
    0

    Does not work:

              Node target = uQuery.GetNodesByXPath("$ancestorOrSelf/* [activeMenu = 'Lawyers' or @id=1672]").FirstOrDefault();
                string activeMenu = target.GetProperty("activeMenu").Value.ToString();
    
                if (activeMenu != null)
                    Response.Write(activeMenu);
                else
                    Response.Write("none");
    
  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Jun 29, 2011 @ 12:49
    Hendy Racher
    0

    Hi Connie,

    Instead of:

     .GetProperty("activeMenu").Value.ToString()

    try:

    .GetProperty<string>("activeMenu");

    HTH,

    Hendy

Please Sign in or register to post replies

Write your reply to:

Draft