More in this section
Forums / General Discussions / Module Builder Item Count?

Module Builder Item Count?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Nate
    Nate avatar
    3 posts
    Registered:
    12 Dec 2014
    12 Jul 2016
    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:
    06 Sep 2017
    15 Jul 2016
    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