What I would like to do is quite simple and I have done similar things using only PHP and MySQL in the past but I like using Drupal and would like to know the best way to put this together.
I have a node type called 'vacancy' which has categories 'jobtype' and 'location' and a CCK field 'annualSalary'. Users need a form so that they can search for jobs that match their desired criteria. I have managed to get this up and running using 'exposed fields' in 'views' but the views form isn't as user friendly as I would have liked.
What I would like to do is to create a vacancy search form (either in a block or a page) and then submit this forms data to a page that returns a list of matching 'vacancies'.
My big questions are:
1. Do I need to create a module for this for can I just add the php code to nodes directly?
2. To find and show the results do you think I should use sql queries or the views module in some way?
3. Am I going about this the wrong way?
My thanks in advance for your help.
Chris
Comments
I would suggest a module
I would suggest a module using SQL queries that creates a block to display the form and search results. Looking at the code from the views module may be helpful for developing the module.
Mike Wacker
Assistant Web Editor, The Cornell Daily Sun
mwacker@cornellsun.com
did you find a solution?
Chris, did you find a solution? I need to do almost exactly the same.
Maybe we can help each other out.. ?
Search Specific Nodes
There's a quick hack here: http://drupal.org/node/68571#comment-247141 that allows you to search a specific node type. The only problem is that it leaves an ugly bit in the search box when it returns the search results.
Im willing to chip in some bounty money for a decent custom search module. The perfect module would allow you to create a search block based on node type and field criteria.
Anyone have any ideas?
How I got around it!
I managed to do what I wanted but I'll be the first to admit its probably not the best way. You can see the results at http://www.offtherec2rec.com/professional-recruitment/
Basically I exposed the fields that I wanted to use in my search form. And then looked at the source code it created. I just lifted the basic form elements from there and stuck them into a plain old block.
Chris of Rowe Website Design & Development
Thanks
Cool thanks chris, im having a look now. Looks like it could do the job for me too! I think it will work for what im doing at the moment.
Mike