fs-cmsslider-element
values and apply necessary Finsweet attributes to wrapper and controls.To manage two different CMS-based sliders on one Webflow page using Finsweet's CMS Slider script, you need to assign unique identifiers to each slider and initialize them separately.
For each Collection List, add Finsweet attributes with unique fs-cmsslider-element
values:
First Collection List Wrapper: fs-cmsslider-element="list1"
Second Collection List Wrapper: fs-cmsslider-element="list2"
Add the following Finsweet attributes to relevant elements:
For each Slider container, set fs-cmsslider="true"
For the pagination elements or navigation arrows (if used), also include proper fs-cmsslider-element="pagination1"
or "pagination2", etc.
tag, and add the Finsweet CDN:
<script src="https://cdn.finsweet.com/files/fscmslibrary/fscmslibrary.js"></script>
Below the CDN include, initialize both sliders with their unique selectors using Finsweet's fsCMSslider
function.
Add the following (without <script>
tags per the guideline):
window.fsAttributes = window.fsAttributes || [];
window.fsAttributes.push([ "cmsslider", (listInstances) => {
const [slider1] = listInstances.filter(item => item.wrapper.getAttribute("fs-cmsslider-element") === "list1");
const [slider2] = listInstances.filter(item => item.wrapper.getAttribute("fs-cmsslider-element") === "list2");
slider1.init();
slider2.init();
}]);
To use Finsweet’s script with two separate CMS sliders, give each Collection List a unique fs-cmsslider-element
and initialize them individually using the Finsweet script. Mismatched or duplicate attributes can cause issues, so ensure each slider instance is clearly identified and targeted in your custom script.