Copied to clipboard

Flag this post as spam?

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


  • Dan 65 posts 209 karma points
    Apr 04, 2014 @ 11:58
    Dan
    0

    How to get unpublished nodes

    I was trying something like

    IEnumerable<umbraco.NodeFactory.Node> nodes = uQuery.GetNodesByType("NodeType").Where(x => x.Parent.NodeTypeAlias.Equals("nodeParentType"));
    

    I read that uQuery should get unpublished nodes but Im not getting any nodes back.

    got in this old post

    http://our.umbraco.org/forum/developers/api-questions/7212-Get-List-Of-Unpublished-Nodes-Of-Specific-DocType

    Hope some one can lead me in a direction :D

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Apr 04, 2014 @ 15:27
    Jeavon Leopold
    101

    Hi Dan,

    By coincidence I answered a very similar query just yesterday here

    You can use the Content Service and it's methods to query unpublished content as documented here

    Jeavon

  • Dan 65 posts 209 karma points
    Apr 06, 2014 @ 19:50
    Dan
    0

    thanks Jeavon

    I will try this !

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Apr 07, 2014 @ 10:45
    Jeavon Leopold
    0

    Awesome, I should add that you can query unpublished content with uQuery using Document however this uses the Umbraco v4 API while the Content Service uses the v6 API so this is the recommend approach.

Please Sign in or register to post replies

Write your reply to:

Draft