Skip Navigation

[Closed] Filter results using a range slider

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 months, 2 weeks ago.

Author
Posts
#2701822

My site gathers philosophy texts written at different times. I'd like to add a simple visual way to filter them by date. I thought about creating a date slider similar to the price sliders on shopping pages that would use data from a custom field 'date'. I found many such slider plugins but they all work with WooCommerce, not with Toolset. Is there a way to create something like this natively in Toolset, or if not, are you aware of any plugins which work with Toolset in this way?

#2701888

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

This is custom work and will require some coding.

You would need a custom field for the date, but it would not be a Toolset Date field, instead just a text or numeric field to store the year.

Then you would insert a custom field filter in your View using the BETWEEN comparison, which would add two inputs, one for the FROM value and another for the TO value.

You would then need to add the UI for a range slider using a 3rd-party solution such as jQueryUI, which would involve ensuring the necessary JS and CSS were enqueued, and then using custom JS to effectively attach the range slider UI to the two form inputs, which would be hidden by CSS, but whose values would be updated via JS as the range slider inputs were updated.

It's not trivial. If you search for the forum you find examples of others doing something similar, but if you are not comfortable coding you may want to recruit a developer to work on this part of the site for you (see https://toolset.com/contractors/).

If you try it yourself and get stuck on something specific, we can try and help.

The topic ‘[Closed] Filter results using a range slider’ is closed to new replies.