Module Builder Item Count? - General Discussions - General Discussions - Progress Community
 General Discussions

Module Builder Item Count?

  • Module Builder Item Count?
  • cd97541e-37c1-6deb-a958-ff0000446526_screen-shot-2016-07-12-at-2-17-28-pm.png

    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

  • 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