CMS is not correctly sorting any items posted after 2026

I’m having an issue on the blog list of my Intellistack Streamline site.

If I set the sort order to newest to oldest, any item published in 2026 will show up last instead of first.

I tried using a Date field and have the same issue. If I change the collection item’s date to Dec 31, 2025 the item will show as the latest but when I change the date to Jan 01, 2026 the item falls all the way to the last page of the list.

When I activate the finsweet attribute by adding fs-list-element=“list” that’s when the sorting gets messed up.

The blog post is “Connect to any system via API…” which shows up on page 7. The other posts that appear after it don’t have a date set so that is expected.

Hey @jolan.green!

It seems that you are missing the fs-list-fieldtype = "date" attribute in your date elements on your collection list items.
There are also some stray elements inside an embed element, with the previous fs-cmssort-element, fs-cmssort-field, and fs-cmssort-order attributes which I recommend you remove, as v1 and v2 attributes are not supported on the same page.

I see you are using a select field to set the sorting order on page load, another way to sort the list once the items have loaded is to use the following callback:

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

      const [listInstance] = listInstances;

      listInstance.addHook('afterRender', (items) => {
        listInstance.sorting.value.fieldKey = 'date';
        listInstance.sorting.value.direction = 'desc'; // modify for your desired sort order
      });
    },
  ]);
</script>

Let me know how it goes with these changes!

I made the updates and the 2026 post now shows up on page 3, which is better but still not working correctly. The “Connect to any system via API” post is dated 2026 and should be the first.

I added the link below to show the dates on each post.

@jolan.green, could you share your read-only link?

I’ll have a look at the setup.

Could you also try using different date formats? :thinking:

@jolan.green, I think I see the issue.

A trigger element is required for the sorting to work on load. You can add this HTML in an embed element inside the filter form

<div style="display: none">
  <a fs-list-element="sort-trigger" fs-list-field="date" fs-list-fieldtype="date">Date trigger</a>
</div>

This is a quick look from my view, reloading the page with this element added and the previous code I shared via override

That worked, thank you!

1 Like