Skip Navigation

[Resolved] Add a filter using manually entered values as number ranges

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 4 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#1464805

Tell us what you are trying to do?
I need to add a filter to this website. The filter should be a drop down menu, listing the options 0 - 9, 10 - 19, and so on up to 50 & up. I can't seem to find documentation showing how to search number ranges (outside of setting a minimum and maximum), and I'm unsure of how to enter it in the form and / or within the code.

Is there any documentation that you are following?
I've been searching in tutorials and community support and haven't seen how to set this up from beginning to end.

Is there a similar example that we can see? Not that I'm aware of.

#1465565

That's not natively supported in Toolset, mainly because it'd be subject to too many customization requests (while one wants steps of 2, another might want steps of 5, etc)

What you can do, assuming you have a Field with those values saved for the posts, you can set up a custom search in a view using custom values, so for example, instead of building a View search that uses all of the precise saved values you created when adding posts with their fields, it uses ranges.

You can use compare if you use two inputs - a max and minimum value. This would help to for example output posts between a value of 1-20 - but you need 2 inputs, as you can set it up in the View search: a maximum and minimum input so Views can search in between those.
But in one single select option, only one value can be passed, not a range of between values.

#1466367

Thank you for the info, Beda!

Is it possible to enter variables within the "add filter" set up pop up box, and then write custom PHP, calling those variables, within the existing code to create this option? It's a client ask, and we are already using Toolset for a lot of the other functionality components within the site.

#1470711
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.