Are you looking for a way to list the number of CMS items in a collection on your page? Webflow can't do this natively yet, but custom code comes to the rescue here (again). Check out how to do this with a super-short custom code snippet.
Have you ever wondered how to automatically count the number of CMS items in a CMS collection and display it on the page? This can for instance be useful if you have one (or several) collection(s) of blog articles and want to show your visitors how many articles are available for him to read. This could be applied to anything like recipes, news articles, tutorials etc. This functionality can't be achieved without custom code, and I'll show you how to do this here.
<script>
$(document).ready(function() {
const mycounter = $('.my-counter').length;$('.mycounter-hack').text(mycounter);});
</script>
This code specifies that all classes with the class name of .my-counter will be counted and output inside the element with the class name .mycounter-hack
This article was inspired by Finsweet's tutorial which you can find here.
Fill out the form below and I'll be in touch with you usually within 48 hours. You can also say hi via email.