CMS Combine merge lists

Trying to implement CMS Combine and have the two lists actually be combined rather than display one after the other.

@Support-Luis provided some code in the Slack, but it’s still not working for me.

Page is here

Hey @nick4! If you want to sort them in a specific order or alphabetically you’ll need to add the complete CMS Sort setup.

If you’d like to sort the list every time the page loads randomly you can test this code:


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

      const [listInstance] = listInstances;

      function shuffle(array) {
        for (let i = array.length - 1; i > 0; i--) {
          const j = Math.floor(Math.random() * (i + 1));
          [array[i], array[j]] = [array[j], array[i]];
        }
        return array;
      }

      let shuffledItems = shuffle(listInstance.items);

      listInstance.clearItems();
      listInstance.items = shuffledItems;
    },
  ]);
</script>

Let me know if this works on your end :muscle: