search-results.tpl.php

  1. 7.x drupal/modules/search/search-results.tpl.php
  2. 6.x drupal/modules/search/search-results.tpl.php

Default theme implementation for displaying search results.

This template collects each invocation of theme_search_result(). This and the child template are dependent to one another sharing the markup for definition lists.

Note that modules may implement their own search type and theme function completely bypassing this template.

Available variables:

  • $search_results: All results as it is rendered through search-result.tpl.php
  • $module: The machine-readable name of the module (tab) being searched, such as "node" or "user".

See also

template_preprocess_search_results()

5 string references to the theme hook from search-results.tpl.php

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

search_data in drupal/modules/search/search.module
Performs a search by calling hook_search_execute().
search_theme in drupal/modules/search/search.module
Implements hook_theme().
search_view in drupal/modules/search/search.pages.inc
Menu callback; presents the search form and/or search results.
template_preprocess_search_results in drupal/modules/search/search.pages.inc
Process variables for search-results.tpl.php.
template_preprocess_search_results in drupal/modules/search/search.pages.inc
Process variables for search-results.tpl.php.

File

drupal/modules/search/search-results.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default theme implementation for displaying search results.
  5. *
  6. * This template collects each invocation of theme_search_result(). This and
  7. * the child template are dependent to one another sharing the markup for
  8. * definition lists.
  9. *
  10. * Note that modules may implement their own search type and theme function
  11. * completely bypassing this template.
  12. *
  13. * Available variables:
  14. * - $search_results: All results as it is rendered through
  15. * search-result.tpl.php
  16. * - $module: The machine-readable name of the module (tab) being searched, such
  17. * as "node" or "user".
  18. *
  19. *
  20. * @see template_preprocess_search_results()
  21. *
  22. * @ingroup themeable
  23. */
  24. ?>
  25. <?php if ($search_results): ?>
  26. <h2><?php print t('Search results');?></h2>
  27. <ol class="search-results <?php print $module; ?>-results">
  28. <?php print $search_results; ?>
  29. </ol>
  30. <?php print $pager; ?>
  31. <?php else : ?>
  32. <h2><?php print t('Your search yielded no results');?></h2>
  33. <?php print search_help('search#noresults', drupal_help_arg()); ?>
  34. <?php endif; ?>

Related topics