List Combine and List Sort on Attributes v2

Hi All,
There is specific documentation on how to use CMS Combine and CMS Sort together to create a sorted combined collection list with Attributes v1, I used this cloneable in the past for that: Attributes Combos - Webflow.
But this documentation on the Attributes legacy page now redirects to Attributes v2 where there is nothing about Attributes combinations.

Is it still possible?
The bit of JS code provided in the v1 docs and that’s supposed to click the hidden button to trigger the sort seems to be referencing the old function names and doesn’t seem to work anymore.

Thank you!
Vincent

Hey @vballestrino! There is no specific documentation for these combinations yet.

However, List Combine and List Sort are meant to work seamlessly. And it is still possible to sort the combined list automatically!

Here is what you need:

A sorting element is required, but it can be hidden, such as a button with the attribute fs-list-element=“sort-trigger”.

This is the API callback that will sort the list. Simply modify the fieldKey and direction to suit your setup!

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

      const [listInstance] = listInstances;

      listInstance.sorting.value.fieldKey = 'name';
      listInstance.sorting.value.direction = 'desc';
    },
  ]);
</script>

You can DM me a link to the page if you need any help!

1 Like