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

By Rohwer - March 22, 2011

So i add all the hidden fields based on the previous query and the action should link to the same page.

Next question is what option value do I use to utilize the CMS viewer to : ORDER BY 'X variable' Asc/Desc ?

Re: [Jason] Filtering Search Results

By Rohwer - March 22, 2011

Works perfectly. Thanks again Jason.