I’m currently setting up a Drupal website with localization which works pretty well. But today I’m confronted with a situation for which I don’t see a clear solution. I’ve been googling around and sniffing through the Drupal forums to find the correct way to solve this situation but I can’t find a solid solution.
In my website I have a page that contains a search form, the user can input a zip code or a breed of a dog/cat. But the hard thing about it is that the data needs to come from an external service. So, no fancy drupal CCK datatypes, views or whatsoever.
So I was wondering what the correct way is to implement some custom php code. What I exactly mean: I need to implement several php scripts that were already programmed by someone else. Think about it like this: someone made a php file with a html form in it, when the user clicks the search button you get redirected to results.php which show the results of the search query in a list.
So, I’m wondering what the best way is to implement such a custom code without rewriting the whole thing (it’s a lot more complex than the stripped down case I’m talking about here, so a complete rewrite isn’t a solution at the moment).
Should I make a custom content type and put php code in a seperate .tpl.php file?
Should I enable the PHP module and start putting in php code in the body field of a page? But what about communicating data over several pages? And so on, … ?
Thanks for you answers.
I’d go with the following:
For a good starting point, take a look at the Apache Solr Search module from Drupal.org
http://drupal.org/project/apachesolr
Bonus points for making it a “live” search with Ajax
http://drupal.org/project/apachesolr_ajax