Copied to clipboard

Flag this post as spam?

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


  • Doobear 21 posts 111 karma points
    Jun 11, 2018 @ 16:18
    Doobear
    0

    Preview unpublished content by DocumentTypeAlias

    Hi there.

    I am getting children of a node for a partial on a home page by getting the node by DocumentTypeAlias and then iterating the items to display them. This works just great.

    var node = Model.Content.Children.FirstOrDefault(x => x.DocumentTypeAlias == "xyz");
    
    var items = node.Children.OrderByDescending(x => x.CreateDate);
    

    Like I say this is working just fine but when in Preview mode the unpublished children still aren't showing.

    Does anyone have any idea how to get the Preview working with unpublished items in this manner?

    Appreciate any help. Many thanks

Please Sign in or register to post replies

Write your reply to:

Draft