Hi
I am trying to add sorting to webflow website. I have add the sricpt:
// 1) Connecting MixItUp JS library using public CDN link
https://cdnjs.cloudflare.com/ajax/libs/mixitup/3.3.0/mixitup.min.js"
// 2) Reusable function to convert any string/text to css-friendly format
var conv = function (str) {
if (!str) {
str = ‘empty’;
} return str.replace(/[!"#$%&'()*+,./:;<=>?@[\]^`{|}~]/g, ‘’)
.replace(/ /g, “-”)
.toLowerCase()
.trim();
};
// 4) Creating custom data-date attributes from blog dates:
var sortArray = document.querySelectorAll(‘.w-dyn-item .sort-category’);
sortArray.forEach( function(sortElem) {
var sortText = sortElem.innerText || sortElem.innerContent;
sortElem.closest(“.mix”).setAttribute(‘data-date’, sortText);
});
// 5) Set the reference to the container. Use the class-name of your Collection List or ID of the Collection List
var containerEl = document.querySelector(‘.posts-collection-list’);
// 6) Call the MixitUp plugin
mixitup(containerEl);
Still it is not working. Please suggest.