Webflow sync, pageviews & more.
NEW

How can I resolve the issue of not being able to sort items on a CMS page in Webflow when using button sorting instead of a dropdown select, especially when navigating to different pages?

TL;DR
  • Use custom JavaScript to update and read sort state from URL parameters, allowing button-based sorting to persist across page loads.
  • Replace Webflow's native pagination with Finsweet’s Attributes (cms-sort and cms-load) for dynamic sorting and load-more functionality that retains sort state.
  • Ensure sorting is used on Collection List Pages, not CMS Template Pages, for client-side functionality to work.

You’re trying to enable CMS item sorting via buttons (not dropdowns) on dynamic CMS pages, but the sorting breaks or resets when navigating across paginated pages. This is because Webflow's native pagination and filtering don't retain custom sort state across page loads.

1. Understand the Limitation

  • Webflow does not support persistent state across paginated CMS pages when using custom button-based filtering or sorting (e.g., buttons like “Sort A–Z” or “Newest”).
  • When pagination is triggered, Webflow reloads the page and loses any sort/filter parameters that were set via button clicks unless those parameters are stored and reapplied with custom code.

2. Use URL Parameters to Store Sort State

  • Make each sort button update the URL with a query parameter (e.g., ?sort=asc or ?sort=date-desc) so the sort state can be captured and reused.
  • This requires custom JavaScript that:
  • Detects the sort parameter on page load.
  • Filters/sorts the CMS list accordingly.
  • Updates the active button style if needed.

3. Disable Native Pagination or Use Load More Instead

  • Consider turning off native pagination in your Collection List settings.
  • Replace it with a “Load More” interaction using Finsweet’s Attributes library or Jetboost, which supports dynamic loading and sort persistence.
  • These tools can manage sort/filter states using URL parameters or custom logic, even after paginated content has been loaded.

4. Use Finsweet’s Attributes Library

  • Finsweet’s cms-sort and cms-load attributes can be combined to support:
  • Button-based sorting.
  • Load more pagination.
  • URL sync for persistent sorting across CMS loads.
  • Required steps:
  • Add Finsweet’s CDN script to your Webflow project.
  • Use fs-cmsfilter-sort="field-name" on buttons.
  • Configure the fs-cmsload attribute to replace native pagination.

5. Avoid CMS Detail Pages for Filtering

  • If you're using a CMS Template Page, custom client-side sorting/filtering will not work reliably because:
  • There’s only one CMS item shown at a time.
  • Lists require being on Collection List pages, not Template Pages.
  • Make sure your list and sorting buttons exist on a Collection List Page, not on CMS Template Pages.

Summary

To sort CMS items with buttons across paginated pages, use custom JavaScript with URL parameters or adopt Finsweet’s Attributes for more effective button-based sorting and persistent loading. Webflow’s native features alone can’t maintain sort state across pagination.

Rate this answer

Other Webflow Questions