Copied to clipboard

Flag this post as spam?

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


  • Brendan Rice 372 posts 608 karma points
    Jun 17, 2011 @ 18:35
    Brendan Rice
    0

    Get all content nodes by property

    I need to get all content nodes by a certain property. Is there any way of doing this?

     

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jun 17, 2011 @ 18:51
    Tom Fulton
    3

    Hi,

    You are wanting to do this in .NET, correct?  One way is to use uQuery from uComponents, something like this:

    using umbraco.presentation.nodeFactory;
    using uComponents.Core.uQueryExtensions;

    List<Node> nodes = uComponents.Core.uQuery.GetNodesByXPath("//* [@isDoc and yourProperty='yourValue'");

    I'm not sure if you can do this using only the built-in NodeFactory.  Another alternative might be to use umbraco.library:GetXmlAll() and filter using xpath - but the uQuery method is nice since it returns a Node object and has several other handy methods.

    Hope this helps,
    Tom

     

  • 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