CMS Filter + CMS Load More, loaded items won't filter

This was how we solved this. Now after my new filter elements are loaded they also filter the collection list. Big thanks to @Support-Luis on sending me this code!

<script>
  window.fsAttributes = window.fsAttributes || [];
  window.fsAttributes.push([
    'cmsload',
    (listInstances) => {
      console.log('cmsload Successfully loaded!');
      const [listInstance] = listInstances;

      listInstance.on('renderitems', (renderedItems) => {
        window.fsAttributes.push([
          'cmsfilter',
          (filterInstances) => {
            console.log('cmsfilter Successfully refreshed!');
            const [filterInstance] = filterInstances;
            filterInstance.storeFiltersData();
          },
        ]);
      });
    },
  ]);
</script>
1 Like