search-results.tpl.php

  1. 7.x drupal-7.x/modules/search/search-results.tpl.php
  2. 6.x drupal-6.x/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()

1 theme call to search-results.tpl.php
search_data in drupal-7.x/modules/search/search.module
Performs a search by calling hook_search_execute().

File

drupal-7.x/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