Hi All,
Apologize if this has been answered in the past, but I am wondering if there is a way for the max/min range of my Range Slider to be set dynamically by the CMS, so that it defaults to being the max and min values input to the CMS. Is this possible with some string of code?
On that same note, is there a way to only display filters options in a collection list that are actually on the page? That would help really trim down the filter list to only what is available.
Hi Luis, thanks so much for your help. I’m not super handy with code, so I will need some instruction on how to implement the API. Here’s a link to the site I am building:
Here’s the two things I would like to have happen:
I want to only show filter options when there are items in the collection list that I am filtering that match those options. So instead of seeing every single “Style” in the styles filter, I only want to see the ones that are currently in the list.
For the price and dimensions sliders, I would like to show only the ranges that are in the list. So the highest priced item in the list should be the top range of the slider. I don’t want to have to put arbitrary units in there, if that makes sense.
hey @joel! This code should work on your end, I’m still chasing a small bug where the minimum value for the range slider is set to 113 instead of 100 with this code, however, you can always comment out the line where the attribute value is modified and leave it at 0.
You’ll need to change the range slider script to
<!-- [Attributes by Finsweet] Range Slider -->
<script
defer
fs-attributes-preventload="true"
src="https://cdn.jsdelivr.net/npm/@finsweet/attributes-rangeslider@1/rangeslider.js"
></script>
And a class like this to a style tag and add this to the input field