Filtering Search Results
5 posts by 2 authors in: Forums > CMS Builder
Last Post: March 22, 2011 (RSS)
By Rohwer - March 22, 2011
I have a search page that works great. On the results page I would like to have a drop down that has options like "Price : High to Low", "Engine Size : Low to High" etc etc...
How can i sort the results on the Results page even further without losing their initial search criteria.
Re: [Rohwer] Filtering Search Results
By Jason - March 22, 2011
If you're going to have these ordering options as form elements (ie, <select>) one thing you can do is store your current search criteria in hidden fields in your form.
For example, if you had a search element called price, you could save it in your new form like this:
<input type = "hidden" name = "price" value = "<?php echo @$_REQUEST['price'];?>" />
Hope this helps get you started.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Filtering Search Results
By Rohwer - March 22, 2011
Next question is what option value do I use to utilize the CMS viewer to : ORDER BY 'X variable' Asc/Desc ?
Re: [Rohwer] Filtering Search Results
By Jason - March 22, 2011
What you would do is give your form element the name orderBy and then the value being how you want it sorted. For example:
<select name = "orderBy">
<option value = "price ASC">Price: Low to High</option>
<option value = "price DESC">Price: High to Low</option>
</select>
Hope this helps
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Jason] Filtering Search Results
By Rohwer - March 22, 2011