Assorted Geekery

Drupal 6 – Customising search results page

In drupal 6, the variable $result is available in search-result.tpl.php. The commented section at the top of this file makes no mention of this variable, so if you want to do something as simple as showing the created date on a node instead of the modified date, then you’re in for a bit of researching (unless you read this blog post!). So, if you want to modify how search results are displayed, then you need to: 1) Copy search-results.tpl.php and search-result.tpl.php from /modules/search to your theme’s folder. 2) Use the $result object as needed within search-result.tpl.php 3) Don’t forget to clear the theme registry by visiting admin/build/themes Here’s my search-result.tpl.php file: