Filtering Search Results

5 posts by 2 authors in: Forums > CMS Builder
Last Post: March 22, 2011   (RSS)

By Rohwer - March 22, 2011

Looked through the forum for a couple days for a similar question but nothing seemed like mine so posting.

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

Hi,

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: [Rohwer] Filtering Search Results

By Jason - March 22, 2011

Hi,

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

Works perfectly. Thanks again Jason.