Create advanced and complex no-code sorting for Webflow CMS Collection List content.
npm install @finsweet/attributes-cmssortcmssort AttributeCreate advanced and complex no-code sorting for Webflow CMS Collection List content.
``html`
You can access the cmssort instances by pushing a callback into the window.fsAttributes object:
`typescript
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([
'cmssort',
(listInstances) => {
console.log('cmssort Successfully loaded!');
// The callback passes a listInstances array with all the CMSList instances on the page.
const [listInstance] = listInstances;
// The renderitems event runs whenever the list renders items after sorting.`
listInstances.listInstance.on('renderitems', (renderedItems) => {
console.log(renderedItems);
});
},
]);
The callback passes an array with all the CMSList instances on the page.CMSList
To see more about the instance, check the cmscore` docs.