Copied to clipboard

Flag this post as spam?

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


  • glob 72 posts 172 karma points
    Jun 09, 2016 @ 15:04
    glob
    0

    Get Unpublished Child node detail using razor

    Hello,

    I am using latest umbraco version.

    Can i get unpublished child nodes list and their properties by using razor script? Is it possible or not?

    Also can i avoid to create link to document url for some nodes on node publish ? Because i don't want to create url for that particular node..

    Awaiting your reply,

    With regards,

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jun 09, 2016 @ 16:39
    Alex Skrypnyk
    101

    Hi Glob,

    You can get unblubished nodes with ContentService -

    https://our.umbraco.org/documentation/reference/management/services/contentservice

    Example:

    var unpublishedNodes = ApplicationContext.Services.ContentService.GetChildren(1010).Where(x => !x.Published);
    

    You can't create node without link. You have to do not use nodes, try to use maybe Archetype blocks, or add some redirect to this node, so users will not be able to go on this node.

    Why you need node without link?

    Cheers, Alex

  • glob 72 posts 172 karma points
    Jun 10, 2016 @ 13:32
    glob
    0

    Hello Alex,

    It is working fine.

    Thank you for your quick response.

    I don't want to publish some nodes and don't want to create links of the same for some reason but need to get them values. now i can get that value with your help without publish. thanks again..

    With Regards,

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Jun 10, 2016 @ 13:46
    Alex Skrypnyk
    0

    You are welcome, Glob, write if you will have some question :)

Please Sign in or register to post replies

Write your reply to:

Draft