Split CMS Collection into Multiple Sections
Split up your Webflow CMS collections into multiple sections with this Javascript code snippet. This allows you to easily break up a collection lists into multiple sections, a great way of adding your own elements in between a Webflow CMS collection list.
Split up your Webflow CMS collections into multiple sections with this Javascript code snippet. This allows you to easily break up a collection lists into multiple sections, a great way of adding your own elements in between a Webflow CMS collection list.
How to add it
- Add the Javascript code snippet to the closing body section
- Update class names to your own class names
The code
Javascript
<!-- Add to closing body section -->
<script>
$(function() {
for (var i = 0; i < $('.tr-wrap .tr-category').length; i++) {
var name = $('.tr-wrap .tr-category').eq( i );
for (var d = 0; d < $('.tr-title').length; d++) {
var title = $('.tr-title').eq( d );
if ( title.text() == name.text() ) {
var parent = name.closest('.tr-item');
var titleContain = title.closest('.tr-contain').find('.tr-list');
parent.appendTo( titleContain );
}
}
}
});
</script>