frequently asked question
Mar 15, 2024

How can I use CMS Combine and CMS Sort together to sort on page load?

This can be achieved with a little custom JS, basically follow these steps:

  1. Add the CMS Sort script after the CMS Combine script
  2. Set up the sort attribute using the docs https://www.finsweet.com/attributes/cms-sort/
  3. Set the sort button to display:hidden and give it a unique class name (ie. ".fs_cmssort_button"). Add the script below before the </body> tag

<script>
 window.fsAttributes = window.fsAttributes || [];
 window.fsAttributes.push([
   'cmscombine',
   (listInstances) => {
     document.querySelector('.fs_cmssort_button').click();
   },
 ]);
</script>

Check more questions and answers

list
list
Mar 15, 2024

How can I use CMS Combine and CMS Sort together to sort on page load?

This can be achieved with a little custom JS, basically follow these steps:

  1. Add the CMS Sort script after the CMS Combine script
  2. Set up the sort attribute using the docs https://www.finsweet.com/attributes/cms-sort/
  3. Set the sort button to display:hidden and give it a unique class name (ie. ".fs_cmssort_button"). Add the script below before the </body> tag

<script>
 window.fsAttributes = window.fsAttributes || [];
 window.fsAttributes.push([
   'cmscombine',
   (listInstances) => {
     document.querySelector('.fs_cmssort_button').click();
   },
 ]);
</script>

false
false
Go to FAQ page