1

I am working on an online directory that will allow users to use the input range type element(a slider) to search for prices. Can this be used with low search this element, or would anyone recommend any other add-ons that would allow for the slider/input range to search my db whilst still using EE.

Thanks

Jam

1 Answer 1

1

Low Search is front-end agnostic. That is, it doesn't really matter what input fields you use in the search form on the front-end, as long as you name them correctly, so Low Search understands them. Input fields always relate to tag parameters: the input name should be identical to the parameter you would use in the Results tag.

In the case of ranges, you can either use a single parameter (using the from and to values 1 to 10 in this example):

range:field_name="1;10"

Or split it in two parameters:

range-from:field_name="1" range-to:field_name="10"

The field_name is the field you're targeting for the range.

Translated to html input elements, this is:

<input name="range:field_name" value="1;10">

...and...

<input name="range-from:field_name" value="1">
<input name="range-to:field_name" value="10">

You can then get the posted values of these parameters using the parameter name, prefixed with low_search_, so:

  • {low_search_range:field_name}
  • {low_search_range-from:field_name}
  • {low_search_range-to:field_name}

You don't need to use <input>s per se; you could also use <select>s. As long as the name attribute equals the parameter name.

So, as long as you make sure the names and values are as they should be, you can use any input element you like. How you implement it, is up to you.

3
  • Thanks for the reply. Implementing as we speak, appreciate the feedback !
    – Sam Crowe
    Commented Oct 10, 2013 at 12:53
  • Low has the ranges docs & examples been removed from the docs? Starting to do preliminary research as I'm building a site that will be using ranges for search parameters, thanks!
    – Siebird
    Commented Apr 30, 2014 at 13:39
  • Docs had a makeover since Low Search 3. Ranges Filter docs are here: gotolow.com/addons/low-search/docs/filters#ranges
    – Low
    Commented Apr 30, 2014 at 14:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.