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:
- Add the CMS Sort script after the CMS Combine script
- Set up the sort attribute using the docs https://www.finsweet.com/attributes/cms-sort/
- 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
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:
- Add the CMS Sort script after the CMS Combine script
- Set up the sort attribute using the docs https://www.finsweet.com/attributes/cms-sort/
- 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>