+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Module Builder Item Count?

Module Builder Item Count?

2 posts, 0 answered
  1. Nate
    Nate avatar
    3 posts
    Registered:
    12 Dec 2014
    12 Jul
    Link to this post

    I would like to display the number of items in a blog or custom module (module builder) without using javascript or displaying the items themselves. This seems like a simple task to only pull the total number of items, entries, listings, etc. Is there a simple way to achieve this?

    Telerik's forum is a good example (Attached screenshot).

     

    Thanks

  2. Svetoslav Manchev
    Svetoslav Manchev avatar
    735 posts
    Registered:
    07 Dec 2016
    15 Jul
    Link to this post
    Hi Nate,

    In that case you do not need the Blogs widget but a Label and set its value from code behind by query the blogs count like::
    var blogPostsCount = Telerik.Sitefinity.Modules.Blogs.BlogsManager.GetManager().GetBlogPosts().Where(b => b.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live).Count();

    Similar is the approach for all the other content types.

    Regards,
    Svetoslav Manchev
    Telerik by Progress
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
2 posts, 0 answered