Hi everyone,
I hope you’re all doing well. I’ve been facing an issue with duplicate items in a Collection List on my website, and I was wondering if anyone could help me out with a solution.
The setup involves a Collection List with multiple items, each containing a checkbox and a label. I’ve noticed that some items with the same name are being displayed multiple times within the list, and it’s causing some confusion for the users.
I did some research and found a similar topic that was raised on this forum before, but unfortunately, there were no clear answers provided to resolve the issue. I tried the suggestions, but they didn’t seem to work as expected. For example, this code works on the first items of the collection list but when I click on load more, the other items are duplicated :
document.addEventListener(“DOMContentLoaded”, function dumpDups() {
const rr = new Set();
for (const div of document.querySelectorAll(“.filter-component”)) {
if (rr.has(div.textContent.trim())) {
div.parentNode.removeChild(div);
}
rr.add(div.textContent.trim());
}
dumpDups();
});
To clarify, I’m using Webflow, and the Collection List is populated from a collection that has some items with identical names. I’d like to display each item only once in the list, even if they share the same name.
Has anyone encountered a similar problem or found a solution to prevent duplicate items in a Collection List? Any guidance or suggestions would be greatly appreciated.
Thank you in advance for your help!
Best regards,
Here is my public share link: (Webflow - Backcar)
Live site : Backar - Découvrez nos véhicules