I need have a search form that will search for content by category and CCK fields. Some of the CCK fields are numeric (dollar amount) and I would like to search for something that is > this and < this.

I have searched the forums without much luck. Could someone tell me how this is achieved or please point me in the right direction?

Many thanks!

Comments

tdimg’s picture

You should be able to built something like this pretty easily with the views module (http://drupal.org/project/views), maybe look into the views filter block module (http://drupal.org/project/views) as well.

Ask away if you need more help with this.

3cwebdev’s picture

Thanks for the reply. I have started playing around with the filter options in the views module. I have had some success but now seem to be stuck.

The 'view' that I created to use as a search form always displays all of the unfiltered nodes before you enter filter criteria. How can I make the view not show any nodes until a criteria is entered.

Example: I click on the search view and it displays a page with the search forms (filters) at the top and no content under it. The search fields do not all need to be entered but when at least one is entered is will show the results.

Settings right now:

Full node page with three arguments, two of which are exposed. The first arg. filters to a node type. The next two are exposed (Max. Price and # of rooms). The two exposed filters are ticked as optional and locked the other options are off.

Thanks for any help with this!

tdimg’s picture

That's something I can't solve at the moment. If you don't get an answer here, you should raise an issue directly in views. But since I'm also interested in the outcome, could you report back to this topic if you get a solution?

Thanks

Passionate_Lass’s picture

Helllo.

Could you write a simple tutorial on how you did this? I have been looking for how to do this everywhere!