I'm using Drupal 7, the basic Drupal search tool. I like what it returns as far as the actual node pages. However, I want to customize the main search results page that shows a list of results after a user enters a term to search by.
Right now it shows a list with a linked title to the node (fine), and then a 'summary' (if you can call it that) that's sort of a jumbled mess of the URL, part of the description field, and some other fields. I just want the description to show up there. I'd also like to add the date field and the associated image for the node in the search results. So I've discovered that I need to customize template.php mytheme_preprocess_search_results function and also search-results.tpl.php (results NOT result).
But I can't figure out how to parse out individual items from what the database is returning so I can make sure to only print those out in the tpl file. I did a var_dump on $search_results and see it returns a big 'ol chunk of HTML and database data...but how do I return just individual fields from the database and print those out?
Right now it just does a print $search_results.
I tried print $title and print $url but drupal complains it doesn't recognize those vars. So what are the vars and how can I use them to display what I want?
I'm also noticing it's showing the author and date for each node in the search results (although I hid this information in the content type)...so I'd also like to hide that information in the search results.
I've found a bunch of stuff online that led me to those two files I referenced, for changing the search results...but nothing that specifically addressed how to grab and use individual fields from the database. I also don't want to use a module, I want to do this with template.php and the tpl.php files if possible.
Thanks for your help in advance!