Streaming live at 10am (PST)

Code help - count number of cms items

Hi

I have seen this post - Adding a dynamic item that counts the number of posts in a collection

Anyone with experience of adding this to webflow? If so can you send me the code and how to get it to work? Perhaps there is a script out there somewhere, although having search extensively not found anything so far.

Thanks very much you lovely people…

2 Likes

so the trick could be to drag in the collection list, set it to display none, but still count the number of posts in jQuery:

CloudApp

<script>

blogNumber = $('.blog-post').length;
$('.blog-count').text(blogNumber);

</script>

hope this helps :slight_smile:

5 Likes

Thank you…that is exactly what I needed

1 Like

Hi, I’m trying this same code on my site to give a count of all blog posts, but I need it to be able to add multiple collection lists together. I have over 200 blog posts so I have a collection list displaying items 1-100 and then 101-200 and 201-300. is there a way to tweak this code to do this? Thank you!

2 Likes

Any updates on this one. Facing the same issue.