Copied to clipboard

Flag this post as spam?

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


  • Manish 373 posts 932 karma points
    Jun 16, 2016 @ 10:18
    Manish
    0

    published and unpublished node count

    Hi

    How i am getting all published and unpublished

    var contentType = ApplicationContext.Services.ContentTypeService.GetContentType("documentTypeALias");
            int unpublishedPages = ApplicationContext.Services.ContentService.GetContentOfContentType(contentType.Id).Where(page => page.Trashed == false && page.Published == false).ToList().Count;
            int publishedPages = ApplicationContext.Services.ContentService.GetContentOfContentType(contentType.Id).Where(page => page.Trashed == false && page.Published == true).ToList().Count;
    

    But problem is that when i unpublished parent node it only +1 as unpublished, not its child

    Thanks Manish

  • Alex Skrypnyk 6182 posts 24283 karma points MVP 8x admin c-trib
    Jun 21, 2016 @ 15:35
    Alex Skrypnyk
    0

    Hi Manish,

    Why did you check for Trashed?

  • Manish 373 posts 932 karma points
    Jun 22, 2016 @ 04:33
    Manish
    0

    Hi Alex

    I don't want to include nodes which is in trash

    Manish

  • 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